Re: [PATCH 03/13] Input: adp5589-keys: add chip_info structure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2024-10-02 at 02:47 -0700, Dmitry Torokhov wrote:
> On Wed, Oct 02, 2024 at 11:13:05AM +0200, Nuno Sá wrote:
> > On Tue, 2024-10-01 at 07:55 -0700, Dmitry Torokhov wrote:
> > > On Tue, Oct 01, 2024 at 03:41:34PM +0200, Nuno Sa wrote:
> > > > Add a more natural chip_info structure and add it to the i2c id table
> > > > driver data so that we do not need an enum a switch() to get the
> > > > specific bits of each device.
> > > > 
> > > > Signed-off-by: Nuno Sa <nuno.sa@xxxxxxxxxx>
> > > > ---
> > > >  drivers/input/keyboard/adp5589-keys.c | 181 ++++++++++++++++++--------------
> > > > --
> > > >  1 file changed, 95 insertions(+), 86 deletions(-)
> > > > 
> > > > diff --git a/drivers/input/keyboard/adp5589-keys.c
> > > > b/drivers/input/keyboard/adp5589-keys.c
> > > > index
> > > > 922d3ab998f3a5dfbaf277f10eb19e5cd1b35415..eaa5440d4f9e14352409dd880cd25435461
> > > > 2bf3
> > > > e 100644
> > > > --- a/drivers/input/keyboard/adp5589-keys.c
> > > > +++ b/drivers/input/keyboard/adp5589-keys.c
> > > > @@ -228,16 +228,20 @@ struct adp_constants {
> > > >  	u8 (*reg) (u8 reg);
> > > >  };
> > > >  
> > > > +struct adp5589_info {
> > > > +	const struct adp_constants *var;
> > > > +	bool support_row5;
> > > 
> > > Is it possible to derive "row5" data from keymap information to avoid
> > > having this fake "adp5585-02-keys" device?
> > > 
> > 
> > This is not a fake device. Looking at the adp5585 datasheet you can see there's
> > module with 25 keys (without GPIO5) and another with 11 GPIOS. From the
> > datasheet:
> > 
> > "- 10 configurable I/Os allowing functions such as Key pad decoding for a matrix
> > of 
> > up to 5 × 5
> > - 11 GPIOs (5 × 6) with ADP5585ACxZ-01-R7 models"
> 
> Ah, I misunderstood. I thought it was a runtime configuration.
> 
> > 
> > Why its named adp5585-02 in the driver I'm not sure. I kept the same name as the
> > i2c
> > id? Should I call it ADP5585-1 instead? Or even ADP5585-1-r7?
> 
> I think this question is better answered by the DT folks.
> 
> BTW, in case of not using row5 we need to describe this pin as a reset
> line for the chip, right?
> 

Oh yes. I can add a reset pin to the bindings. And make it false for the model where
R5 is in place.

- Nuno Sá 






[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux