mbox series

[v2,0/2] Add a property in at24.c

Message ID 1529994128-26770-1-git-send-email-alanx.chiang@intel.com
Headers show
Series Add a property in at24.c | expand

Message

Chiang, AlanX June 26, 2018, 6:22 a.m. UTC
From: "alanx.chiang" <alanx.chiang@intel.com>

In at24.c, it uses 8-bit addressing by default. In this patch,
add a property address-width that provides a flexible method to
pass the information to the driver.

alanx.chiang (2):
  dt-bindings: at24: Add address-width property
  eeprom: at24: Add support for address-width property

 Documentation/devicetree/bindings/eeprom/at24.txt |  2 ++
 drivers/misc/eeprom/at24.c                        | 16 ++++++++++++++++
 2 files changed, 18 insertions(+)

Comments

Bartosz Golaszewski June 26, 2018, 7:41 a.m. UTC | #1
2018-06-26 8:22 GMT+02:00  <alanx.chiang@intel.com>:
> From: "alanx.chiang" <alanx.chiang@intel.com>
>
> In at24.c, it uses 8-bit addressing by default. In this patch,
> add a property address-width that provides a flexible method to
> pass the information to the driver.
>
> alanx.chiang (2):
>   dt-bindings: at24: Add address-width property
>   eeprom: at24: Add support for address-width property
>
>  Documentation/devicetree/bindings/eeprom/at24.txt |  2 ++
>  drivers/misc/eeprom/at24.c                        | 16 ++++++++++++++++
>  2 files changed, 18 insertions(+)
>
> --
> 2.7.4
>

What is your use case exactly? Do you have an EEPROM model that's not
yet supported explicitly in the driver? Why would you need this
option?

Best regards,
Bartosz Golaszewski
Andy Shevchenko June 26, 2018, 12:14 p.m. UTC | #2
On Tue, 2018-06-26 at 09:41 +0200, Bartosz Golaszewski wrote:
> 2018-06-26 8:22 GMT+02:00  <alanx.chiang@intel.com>:
> > From: "alanx.chiang" <alanx.chiang@intel.com>
> > 
> > In at24.c, it uses 8-bit addressing by default. In this patch,
> > add a property address-width that provides a flexible method to
> > pass the information to the driver.
> > 
> > alanx.chiang (2):
> >   dt-bindings: at24: Add address-width property
> >   eeprom: at24: Add support for address-width property
> > 
> >  Documentation/devicetree/bindings/eeprom/at24.txt |  2 ++
> >  drivers/misc/eeprom/at24.c                        | 16
> > ++++++++++++++++
> >  2 files changed, 18 insertions(+)
> > 
> > --
> > 2.7.4
> > 
> 
> What is your use case exactly? Do you have an EEPROM model that's not
> yet supported explicitly in the driver? Why would you need this
> option?

The current at24 driver has no address width support, thus, reusing same
(allocated) IDs (non-DT case) is hard.
Bartosz Golaszewski June 26, 2018, 12:36 p.m. UTC | #3
2018-06-26 14:14 GMT+02:00 Andy Shevchenko <andriy.shevchenko@linux.intel.com>:
> On Tue, 2018-06-26 at 09:41 +0200, Bartosz Golaszewski wrote:
>> 2018-06-26 8:22 GMT+02:00  <alanx.chiang@intel.com>:
>> > From: "alanx.chiang" <alanx.chiang@intel.com>
>> >
>> > In at24.c, it uses 8-bit addressing by default. In this patch,
>> > add a property address-width that provides a flexible method to
>> > pass the information to the driver.
>> >
>> > alanx.chiang (2):
>> >   dt-bindings: at24: Add address-width property
>> >   eeprom: at24: Add support for address-width property
>> >
>> >  Documentation/devicetree/bindings/eeprom/at24.txt |  2 ++
>> >  drivers/misc/eeprom/at24.c                        | 16
>> > ++++++++++++++++
>> >  2 files changed, 18 insertions(+)
>> >
>> > --
>> > 2.7.4
>> >
>>
>> What is your use case exactly? Do you have an EEPROM model that's not
>> yet supported explicitly in the driver? Why would you need this
>> option?
>
> The current at24 driver has no address width support, thus, reusing same
> (allocated) IDs (non-DT case) is hard.
>

Every supported compatible has the width already specified in its
corresponding chip data.

Bart
Andy Shevchenko June 26, 2018, 1:23 p.m. UTC | #4
On Tue, 2018-06-26 at 14:36 +0200, Bartosz Golaszewski wrote:
> 2018-06-26 14:14 GMT+02:00 Andy Shevchenko
> <andriy.shevchenko@linux.intel.com>:
> > On Tue, 2018-06-26 at 09:41 +0200, Bartosz Golaszewski wrote:

> > > What is your use case exactly? Do you have an EEPROM model that's
> > > not
> > > yet supported explicitly in the driver? Why would you need this
> > > option?
> > 
> > The current at24 driver has no address width support,

> >  thus, reusing same
> > (allocated) IDs (non-DT case) is hard.

^^^^^

> Every supported compatible has the width already specified in its
> corresponding chip data.


Please, read again carefully what I wrote before.
Bartosz Golaszewski June 26, 2018, 1:30 p.m. UTC | #5
2018-06-26 15:23 GMT+02:00 Andy Shevchenko <andriy.shevchenko@linux.intel.com>:
> On Tue, 2018-06-26 at 14:36 +0200, Bartosz Golaszewski wrote:
>> 2018-06-26 14:14 GMT+02:00 Andy Shevchenko
>> <andriy.shevchenko@linux.intel.com>:
>> > On Tue, 2018-06-26 at 09:41 +0200, Bartosz Golaszewski wrote:
>
>> > > What is your use case exactly? Do you have an EEPROM model that's
>> > > not
>> > > yet supported explicitly in the driver? Why would you need this
>> > > option?
>> >
>> > The current at24 driver has no address width support,
>
>> >  thus, reusing same
>> > (allocated) IDs (non-DT case) is hard.
>
> ^^^^^
>
>> Every supported compatible has the width already specified in its
>> corresponding chip data.
>
>
> Please, read again carefully what I wrote before.
>

Ok makes sense in that case. Could you just point me towards an
example model which has the address width different than the default
for its type?

Bart
Andy Shevchenko June 26, 2018, 3:48 p.m. UTC | #6
On Tue, 2018-06-26 at 15:30 +0200, Bartosz Golaszewski wrote:
> 2018-06-26 15:23 GMT+02:00 Andy Shevchenko <andriy.shevchenko@linux.in
> tel.com>:
> > On Tue, 2018-06-26 at 14:36 +0200, Bartosz Golaszewski wrote:
> > > 2018-06-26 14:14 GMT+02:00 Andy Shevchenko
> > > <andriy.shevchenko@linux.intel.com>:
> > > > On Tue, 2018-06-26 at 09:41 +0200, Bartosz Golaszewski wrote:
> > > > > What is your use case exactly? Do you have an EEPROM model
> > > > > that's
> > > > > not
> > > > > yet supported explicitly in the driver? Why would you need
> > > > > this
> > > > > option?
> > > > 
> > > > The current at24 driver has no address width support,
> > > >  thus, reusing same
> > > > (allocated) IDs (non-DT case) is hard.
> > 
> > ^^^^^
> > 
> > > Every supported compatible has the width already specified in its
> > > corresponding chip data.
> > 
> > 
> > Please, read again carefully what I wrote before.
> > 
> 
> Ok makes sense in that case. Could you just point me towards an
> example model which has the address width different than the default
> for its type?

AFAIK, it's a companion device inside the camera voice coil IC, i.e.
DONGWOON DW9714.
Yeh, Andy June 26, 2018, 4:21 p.m. UTC | #7
> -----Original Message-----
> From: Andy Shevchenko [mailto:andriy.shevchenko@linux.intel.com]
> Sent: Tuesday, June 26, 2018 11:48 PM
> To: Bartosz Golaszewski <brgl@bgdev.pl>
> Cc: Chiang, AlanX <alanx.chiang@intel.com>; linux-i2c <linux-
> i2c@vger.kernel.org>; Yeh, Andy <andy.yeh@intel.com>; Sakari Ailus
> <sakari.ailus@linux.intel.com>; Mani, Rajmohan <rajmohan.mani@intel.com>;
> Andy Shevchenko <andy.shevchenko@gmail.com>; Rob Herring
> <robh+dt@kernel.org>; Mark Rutland <mark.rutland@arm.com>; Arnd
> Bergmann <arnd@arndb.de>; Greg Kroah-Hartman
> <gregkh@linuxfoundation.org>; Linux Kernel Mailing List <linux-
> kernel@vger.kernel.org>
> Subject: Re: [PATCH v2 0/2] Add a property in at24.c
> 
> On Tue, 2018-06-26 at 15:30 +0200, Bartosz Golaszewski wrote:
> > 2018-06-26 15:23 GMT+02:00 Andy Shevchenko
> <andriy.shevchenko@linux.in
> > tel.com>:
> > > On Tue, 2018-06-26 at 14:36 +0200, Bartosz Golaszewski wrote:
> > > > 2018-06-26 14:14 GMT+02:00 Andy Shevchenko
> > > > <andriy.shevchenko@linux.intel.com>:
> > > > > On Tue, 2018-06-26 at 09:41 +0200, Bartosz Golaszewski wrote:
> > > > > > What is your use case exactly? Do you have an EEPROM model
> > > > > > that's not yet supported explicitly in the driver? Why would
> > > > > > you need this option?
> > > > >
> > > > > The current at24 driver has no address width support,  thus,
> > > > > reusing same
> > > > > (allocated) IDs (non-DT case) is hard.
> > >
> > > ^^^^^
> > >
> > > > Every supported compatible has the width already specified in its
> > > > corresponding chip data.
> > >
> > >
> > > Please, read again carefully what I wrote before.
> > >
> >
> > Ok makes sense in that case. Could you just point me towards an
> > example model which has the address width different than the default
> > for its type?
> 
> AFAIK, it's a companion device inside the camera voice coil IC, i.e.
> DONGWOON DW9714.
> 

Nope, actually it is DW9807 instead, which is used on a Samsung Chromebook.

> --
> Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Intel Finland Oy
Mani, Rajmohan June 26, 2018, 4:31 p.m. UTC | #8
Hi Bartosz,

> -----Original Message-----
> From: Yeh, Andy
> Sent: Tuesday, June 26, 2018 9:21 AM
> To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>; Bartosz
> Golaszewski <brgl@bgdev.pl>
> Cc: Chiang, AlanX <alanx.chiang@intel.com>; linux-i2c <linux-
> i2c@vger.kernel.org>; Sakari Ailus <sakari.ailus@linux.intel.com>; Mani,
> Rajmohan <rajmohan.mani@intel.com>; Andy Shevchenko
> <andy.shevchenko@gmail.com>; Rob Herring <robh+dt@kernel.org>; Mark
> Rutland <mark.rutland@arm.com>; Arnd Bergmann <arnd@arndb.de>; Greg
> Kroah-Hartman <gregkh@linuxfoundation.org>; Linux Kernel Mailing List
> <linux-kernel@vger.kernel.org>
> Subject: RE: [PATCH v2 0/2] Add a property in at24.c
> 
> > -----Original Message-----
> > From: Andy Shevchenko [mailto:andriy.shevchenko@linux.intel.com]
> > Sent: Tuesday, June 26, 2018 11:48 PM
> > To: Bartosz Golaszewski <brgl@bgdev.pl>
> > Cc: Chiang, AlanX <alanx.chiang@intel.com>; linux-i2c <linux-
> > i2c@vger.kernel.org>; Yeh, Andy <andy.yeh@intel.com>; Sakari Ailus
> > <sakari.ailus@linux.intel.com>; Mani, Rajmohan
> > <rajmohan.mani@intel.com>; Andy Shevchenko
> > <andy.shevchenko@gmail.com>; Rob Herring <robh+dt@kernel.org>; Mark
> > Rutland <mark.rutland@arm.com>; Arnd Bergmann <arnd@arndb.de>; Greg
> > Kroah-Hartman <gregkh@linuxfoundation.org>; Linux Kernel Mailing List
> > <linux- kernel@vger.kernel.org>
> > Subject: Re: [PATCH v2 0/2] Add a property in at24.c
> >
> > On Tue, 2018-06-26 at 15:30 +0200, Bartosz Golaszewski wrote:
> > > 2018-06-26 15:23 GMT+02:00 Andy Shevchenko
> > <andriy.shevchenko@linux.in
> > > tel.com>:
> > > > On Tue, 2018-06-26 at 14:36 +0200, Bartosz Golaszewski wrote:
> > > > > 2018-06-26 14:14 GMT+02:00 Andy Shevchenko
> > > > > <andriy.shevchenko@linux.intel.com>:
> > > > > > On Tue, 2018-06-26 at 09:41 +0200, Bartosz Golaszewski wrote:
> > > > > > > What is your use case exactly? Do you have an EEPROM model
> > > > > > > that's not yet supported explicitly in the driver? Why would
> > > > > > > you need this option?
> > > > > >
> > > > > > The current at24 driver has no address width support,  thus,
> > > > > > reusing same
> > > > > > (allocated) IDs (non-DT case) is hard.
> > > >
> > > > ^^^^^
> > > >
> > > > > Every supported compatible has the width already specified in
> > > > > its corresponding chip data.
> > > >
> > > >
> > > > Please, read again carefully what I wrote before.
> > > >
> > >
> > > Ok makes sense in that case. Could you just point me towards an
> > > example model which has the address width different than the default
> > > for its type?
> >
> > AFAIK, it's a companion device inside the camera voice coil IC, i.e.
> > DONGWOON DW9714.
> >
> 
> Nope, actually it is DW9807 instead, which is used on a Samsung Chromebook.

M24C64S is one example, where reusing same id (non-DT case) is not possible,
since this model uses 16 bits as address width, as the driver supports only
8 bits address width as default.

Thanks
Raj
Andy Shevchenko June 26, 2018, 4:38 p.m. UTC | #9
On Tue, 2018-06-26 at 16:21 +0000, Yeh, Andy wrote:

> > > Ok makes sense in that case. Could you just point me towards an
> > > example model which has the address width different than the
> > > default
> > > for its type?
> > 
> > AFAIK, it's a companion device inside the camera voice coil IC, i.e.
> > DONGWOON DW9714.
> > 
> 
> Nope, actually it is DW9807 instead, which is used on a Samsung
> Chromebook.

Ah, okay, good to know.