All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodolfo Giometti <giometti@enneenne.com>
To: Adrian Fiergolski <Adrian.Fiergolski@cern.ch>
Cc: Peter Rosin <peda@axentia.se>,
	linux-i2c@vger.kernel.org, giometti@linux.it
Subject: Re: [PATCH] i2c: Add support for NXP PCA984x family.
Date: Mon, 11 Dec 2017 14:29:09 +0100	[thread overview]
Message-ID: <f2bd4153-871f-0f71-2825-6225f0ec19d5@enneenne.com> (raw)
In-Reply-To: <d49bb560-0481-b449-b911-6d4d802a4cbd@cern.ch>

On 11/12/17 14:15, Adrian Fiergolski wrote:
> On 11.12.2017 at 13:51, Peter Rosin wrote:
>> On 2017-12-11 12:25, Rodolfo Giometti wrote:
>>> On 11/12/17 12:10, Adrian Fiergolski wrote:
>>>> This patch exetends the current i2c-mux-pca954x driver and adds suuport for
>>>> a newer PCA984x family of the I2C switches and multiplexers from NXP.
>>>> In probe function, the patch supports device ID function, introduced in the
>>>> new family, and checks it against configuration provided by the
>>>> devicetree. Moreover, it also performs software reset which is now
>>>> available for the new devices.
>>>> The reset of the code remains common with the legacy PCA954x devices.
>>>>
>>>> Signed-off-by: Adrian Fiergolski <adrian.fiergolski@cern.ch>
>>>> ---
>>>>    .../{i2c-mux-pca954x.txt => i2c-mux-pca9x4x.txt}   |   5 +-
>>>>    arch/arm/configs/aspeed_g4_defconfig               |   2 +-
>>>>    arch/arm/configs/aspeed_g5_defconfig               |   2 +-
>>>>    arch/arm/configs/multi_v7_defconfig                |   2 +-
>>>>    arch/arm/configs/pxa_defconfig                     |   2 +-
>>>>    arch/arm/configs/tegra_defconfig                   |   2 +-
>>>>    arch/arm64/configs/defconfig                       |   2 +-
>>>>    arch/powerpc/configs/85xx-hw.config                |   2 +-
>>>>    drivers/i2c/muxes/Kconfig                          |   6 +-
>>>>    drivers/i2c/muxes/Makefile                         |   2 +-
>>>>    drivers/i2c/muxes/i2c-mux-pca9541.c                |   4 +-
>>>>    .../muxes/{i2c-mux-pca954x.c => i2c-mux-pca9x4x.c} | 295 ++++++++++++++++-----
>>>>    .../linux/platform_data/{pca954x.h => pca9x4x.h}   |  15 +-
>>>>    13 files changed, 246 insertions(+), 95 deletions(-)
>>>>    rename Documentation/devicetree/bindings/i2c/{i2c-mux-pca954x.txt => i2c-mux-pca9x4x.txt} (91%)
>>>>    rename drivers/i2c/muxes/{i2c-mux-pca954x.c => i2c-mux-pca9x4x.c} (56%)
>>>>    rename include/linux/platform_data/{pca954x.h => pca9x4x.h} (80%)
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.txt b/Documentation/devicetree/bindings/i2c/i2c-mux-pca9x4x.txt
>>>> similarity index 91%
>>>> rename from Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.txt
>>>> rename to Documentation/devicetree/bindings/i2c/i2c-mux-pca9x4x.txt
>>>> index aa097045a10e..cf9a075ca1dd 100644
>>>> --- a/Documentation/devicetree/bindings/i2c/i2c-mux-pca954x.txt
>>>> +++ b/Documentation/devicetree/bindings/i2c/i2c-mux-pca9x4x.txt
>>>> @@ -1,10 +1,11 @@
>>>> -* NXP PCA954x I2C bus switch
>>>> +* NXP PCA9x4x I2C bus switch
>>>>    
>>>>    Required Properties:
>>>>    
>>>>      - compatible: Must contain one of the following.
>>>>        "nxp,pca9540", "nxp,pca9542", "nxp,pca9543", "nxp,pca9544",
>>>> -    "nxp,pca9545", "nxp,pca9546", "nxp,pca9547", "nxp,pca9548"
>>>> +    "nxp,pca9545", "nxp,pca9546", "nxp,pca9547", "nxp,pca9548",
>>>> +    "nxp,pca9846", "nxp,pca9847", "nxp,pca9848", "nxp,pca9849"
>>>>    
>>>>      - reg: The I2C address of the device.
>>>>    
>>>> diff --git a/arch/arm/configs/aspeed_g4_defconfig b/arch/arm/configs/aspeed_g4_defconfig
>>>> index d23b9d56a88b..a461ad3cf63d 100644
>>>> --- a/arch/arm/configs/aspeed_g4_defconfig
>>>> +++ b/arch/arm/configs/aspeed_g4_defconfig
>>>> @@ -116,7 +116,7 @@ CONFIG_I2C=y
>>>>    CONFIG_I2C_CHARDEV=y
>>>>    CONFIG_I2C_MUX=y
>>>>    CONFIG_I2C_MUX_PCA9541=y
>>>> -CONFIG_I2C_MUX_PCA954x=y
>>>> +CONFIG_I2C_MUX_PCA9x4x=y
>>> Nak.
>>>
>>> I'm not sure you should break backward compatibility. You should keep the
>>> CONFIG_I2C_MUX_PCA954x configuration setting and the current name convention.
>> Right, definitely avoid the mass rename. In addition to the pointless
>> churn, pca9x4x is just plain wrong since it matches e.g. pca9745 which
>> has nothing whatsoever to do with this driver.
>>
>> I'll add more comments once the rename noise is gone.
>>
>> Cheers,
>> Peter
>>
> Thanks for comments.
> What do you suggest then ? I could keep CONFIG_I2C_MUX_PCA954x, but
> then, since there is a common source, if enabled, the PCA985x family
> support would be provided as well anyway. I could try to move PCA985x
> features to a separate file which would be included by i2c-mux-pca954x.c
> if a dedicated CONFIG_I2C_MUX_PCA984x is enabled, but it doesn't seem to
> be an elegant solution to me.
> 
> I understand, that your main concern regards CONFIG_I2C_MUX_PCA954x
> only. The fact that internal data types and files have been renamed to a
> more generic and actual pca9x5x style is fine, right ?

None. Just drop the mass rename and add support for the new family. Also don't 
forget to mention the new support into documentation/configuration files.

Ciao,

Rodolfo

-- 

HCE Engineering                      e-mail: giometti@hce-engineering.it
GNU/Linux Solutions                          giometti@enneenne.com
Linux Device Driver                          giometti@linux.it
Embedded Systems                     phone:  +39 349 2432127
UNIX programming                     skype:  rodolfo.giometti
Cosino Project - the quick prototyping embedded system - www.cosino.it
Freelance ICT Italia - Consulente ICT Italia - www.consulenti-ict.it

  parent reply	other threads:[~2017-12-11 13:36 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-11 11:10 [PATCH] i2c: Add support for NXP PCA984x family Adrian Fiergolski
2017-12-11 11:25 ` Rodolfo Giometti
2017-12-11 12:51   ` Peter Rosin
2017-12-11 13:15     ` Adrian Fiergolski
2017-12-11 13:26       ` Peter Rosin
2017-12-11 13:29       ` Rodolfo Giometti [this message]
2017-12-11 14:27         ` [PATCH v2] " Adrian Fiergolski
2017-12-11 14:59           ` Peter Rosin
2017-12-11 15:07           ` Rodolfo Giometti
2017-12-11 16:58             ` [PATCH v3] " Adrian Fiergolski
2017-12-11 19:14               ` Peter Rosin
2017-12-12 12:06                 ` Adrian Fiergolski
2017-12-12 15:25                   ` Peter Rosin
2017-12-12 17:14                     ` Adrian Fiergolski
2017-12-12 19:03                       ` Peter Rosin
2017-12-12 22:05                         ` Wolfram Sang
2017-12-13 17:17                           ` Adrian Fiergolski
2017-12-14  0:30                             ` Wolfram Sang
2017-12-13  8:47                         ` Adrian Fiergolski
2017-12-13  9:39                           ` Peter Rosin
2017-12-13 10:02                             ` Adrian Fiergolski
2017-12-13 16:12                         ` [PATCH v4] " Adrian Fiergolski
2017-12-13 16:56                           ` Wolfram Sang
2017-12-15  9:46                             ` Rodolfo Giometti
2017-12-13 18:26                           ` Peter Rosin
2017-12-14  9:54                             ` Peter Rosin
     [not found]                               ` <990e4a1f-a9ac-c899-0075-ae3211ff9475-koto5C5qi+TLoDKTGw+V6w@public.gmane.org>
2017-12-14 11:20                                 ` [PATCH v5] " Adrian Fiergolski
     [not found]                                   ` <20171214112003.13701-1-adrian.fiergolski-vJEk5272eHo@public.gmane.org>
2017-12-14 21:22                                     ` Peter Rosin
2017-12-18 17:45                                       ` [PATCH v6] " Adrian Fiergolski
2017-12-20 18:27                                         ` Rob Herring
2017-12-25 21:26                                           ` [PATCH v7] " Adrian Fiergolski
     [not found]                                             ` <20171225212646.8062-1-adrian.fiergolski-vJEk5272eHo@public.gmane.org>
2017-12-26 17:58                                               ` Rob Herring
2017-12-28 23:31                                               ` Peter Rosin
2017-12-15 10:40                                     ` [PATCH v5] " Peter Rosin
2017-12-12 19:03                 ` [PATCH v3] " Peter Rosin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f2bd4153-871f-0f71-2825-6225f0ec19d5@enneenne.com \
    --to=giometti@enneenne.com \
    --cc=Adrian.Fiergolski@cern.ch \
    --cc=giometti@linux.it \
    --cc=linux-i2c@vger.kernel.org \
    --cc=peda@axentia.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.