From: Sascha Hauer <s.hauer@pengutronix.de>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] mfd: mc34704: fix register reading
Date: Wed, 21 Oct 2020 11:56:52 +0200 [thread overview]
Message-ID: <20201021095652.GW13710@pengutronix.de> (raw)
In-Reply-To: <20201020111208.14216-1-u.kleine-koenig@pengutronix.de>
On Tue, Oct 20, 2020 at 01:12:08PM +0200, Uwe Kleine-König wrote:
> According to the data sheet (MC34704 Rev. 8.0, 12/2014) must always have
> the MSB set in the "Sub-address" byte for reads.
>
> This fixes reading out registers on a MC34704AEP chip.
>
> Fixes: 514387711f2d ("i2c: add driver for the MC34704 PMIC")
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> drivers/mfd/mc34704.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Applied, thanks
Sascha
>
> diff --git a/drivers/mfd/mc34704.c b/drivers/mfd/mc34704.c
> index 4aa02b74ff20..29071c5ccfce 100644
> --- a/drivers/mfd/mc34704.c
> +++ b/drivers/mfd/mc34704.c
> @@ -43,7 +43,7 @@ int mc34704_reg_read(struct mc34704 *mc34704, u8 reg, u8 *val)
> {
> int ret;
>
> - ret = i2c_read_reg(mc34704->client, reg, val, 1);
> + ret = i2c_read_reg(mc34704->client, 1 << 7 | reg, val, 1);
>
> return ret == 1 ? 0 : ret;
> }
> @@ -112,7 +112,7 @@ static int mc34704_probe(struct device_d *dev)
> mc34704_dev = xzalloc(sizeof(struct mc34704));
> mc34704_dev->cdev.name = DRIVERNAME;
> mc34704_dev->client = to_i2c_client(dev);
> - mc34704_dev->cdev.size = 256;
> + mc34704_dev->cdev.size = 128;
> mc34704_dev->cdev.dev = dev;
> mc34704_dev->cdev.ops = &mc34704_fops;
>
> --
> 2.28.0
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2020-10-21 9:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-20 11:12 Uwe Kleine-König
2020-10-21 9:56 ` Sascha Hauer [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=20201021095652.GW13710@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=u.kleine-koenig@pengutronix.de \
/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