linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Jeremy Fertic <jeremyfertic@gmail.com>
Cc: Shreeya Patel <shreeya.patel23498@gmail.com>,
	lars@metafoo.de, Michael.Hennerich@analog.com, knaack.h@gmx.de,
	pmeerw@pmeerw.net, gregkh@linuxfoundation.org,
	linux-iio@vger.kernel.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Staging: iio: adt7316: Add regmap support
Date: Sat, 12 Jan 2019 17:02:52 +0000	[thread overview]
Message-ID: <20190112170252.56406302@archlinux> (raw)
In-Reply-To: <20190105220413.GA3449@r2700x.localdomain>

...  
> > > diff --git a/drivers/staging/iio/addac/adt7316.h b/drivers/staging/iio/addac/adt7316.h
> > > index fd7c5c92b599..2c72cf3f71cd 100644
> > > --- a/drivers/staging/iio/addac/adt7316.h
> > > +++ b/drivers/staging/iio/addac/adt7316.h
> > > @@ -11,16 +11,13 @@
> > >  
> > >  #include <linux/types.h>
> > >  #include <linux/pm.h>
> > > +#include <linux/regmap.h>
> > >  
> > >  #define ADT7316_REG_MAX_ADDR		0x3F
> > >  
> > > -struct adt7316_bus {
> > > -	void *client;
> > > -	int irq;
> > > -	int (*read)(void *client, u8 reg, u8 *data);
> > > -	int (*write)(void *client, u8 reg, u8 val);
> > > -	int (*multi_read)(void *client, u8 first_reg, u8 count, u8 *data);
> > > -	int (*multi_write)(void *client, u8 first_reg, u8 count, u8 *data);
> > > +static const struct regmap_config adt7316_regmap_config = {
> > > +	.reg_bits = 8,
> > > +	.val_bits = 10,  
> 
> I wonder if val_bits should be 8. The driver can read and write 8, 10,
> or 12 bit values. In the 10 and 12 bit cases, the driver currently
> (including with this patch) does two separate reads or writes and expects
> an 8 bit result from each. It then parses these two values to come up with
> the 10 or 12 bit value. I don't think the logic for this calculation is
> known to regmap, so with the current form of the patch, I think val_bits
> should be 8. Maybe there is a better way to do it though?

Good point. I would assume they should be 8 as well.


> 
> I would have tested this but I couldn't get the patch to apply. Shreeya,
> I think if you rebase against iio/testing that might take care of it. I
> can then do some testing with v2.
>
Great.

Jonathan 
> Jeremy

      reply	other threads:[~2019-01-12 17:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-23 14:02 [PATCH] Staging: iio: adt7316: Add regmap support Shreeya Patel
2019-01-05 17:20 ` Jonathan Cameron
2019-01-05 22:04   ` Jeremy Fertic
2019-01-12 17:02     ` Jonathan Cameron [this message]

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=20190112170252.56406302@archlinux \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jeremyfertic@gmail.com \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=shreeya.patel23498@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).