From: Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: Elaine Zhang <zhangqing-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
Cc: lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
huangtao-TNX95d0MmH7DzftRWevZcw@public.gmane.org,
xxx-TNX95d0MmH7DzftRWevZcw@public.gmane.org,
linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
chenjh-TNX95d0MmH7DzftRWevZcw@public.gmane.org,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
mark.rutland-5wv7dgnIgG8@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
w.egorov-guT5V/WYfQezQB+pC5nmwQ@public.gmane.org
Subject: Re: [PATCH v5 1/7] mfd: rk808: fix up the chip id get failed
Date: Mon, 3 Apr 2017 12:00:26 +0100 [thread overview]
Message-ID: <20170403110026.wutdgzz35h7h7l24@dell> (raw)
In-Reply-To: <1490595705-28844-2-git-send-email-zhangqing-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
On Mon, 27 Mar 2017, Elaine Zhang wrote:
> the rk8xx chip id is:
> ((MSB << 8) | LSB) & 0xfff0
>
> Signed-off-by: Elaine Zhang <zhangqing-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
> ---
It's usually helpful to keep a changelog here:
v3 => v4:
- Stuff that happened
v2 => v3:
- Stuff that happened
v1 => v2:
- Stuff that happened
> drivers/mfd/rk808.c | 21 +++++++++++++++------
> include/linux/mfd/rk808.h | 1 +
> 2 files changed, 16 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/mfd/rk808.c b/drivers/mfd/rk808.c
> index fd087cbb0bde..3334a2a7f3fb 100644
> --- a/drivers/mfd/rk808.c
> +++ b/drivers/mfd/rk808.c
> @@ -325,7 +325,7 @@ static int rk808_probe(struct i2c_client *client,
> void (*pm_pwroff_fn)(void);
> int nr_pre_init_regs;
> int nr_cells;
> - int pm_off = 0;
> + int pm_off = 0, msb, lsb;
> int ret;
> int i;
>
> @@ -333,14 +333,23 @@ static int rk808_probe(struct i2c_client *client,
> if (!rk808)
> return -ENOMEM;
>
> - rk808->variant = i2c_smbus_read_word_data(client, RK808_ID_MSB);
> - if (rk808->variant < 0) {
> - dev_err(&client->dev, "Failed to read the chip id at 0x%02x\n",
> + /* read Chip variant */
Please use correct grammar.
"Read chip variant"
> + msb = i2c_smbus_read_byte_data(client, RK808_ID_MSB);
> + if (msb < 0) {
> + dev_err(&client->dev, "failed to read the chip id at 0x%x\n",
Although this error messages makes the comment above redundant.
> RK808_ID_MSB);
> - return rk808->variant;
> + return msb;
> }
>
> - dev_dbg(&client->dev, "Chip id: 0x%x\n", (unsigned int)rk808->variant);
> + lsb = i2c_smbus_read_byte_data(client, RK808_ID_LSB);
> + if (lsb < 0) {
> + dev_err(&client->dev, "failed to read the chip id at 0x%x\n",
> + RK808_ID_LSB);
> + return lsb;
> + }
> +
> + rk808->variant = ((msb << 8) | lsb) & RK8XX_ID_MSK;
> + dev_info(&client->dev, "Chip id: 0x%x\n", (unsigned int)rk808->variant);
>
> switch (rk808->variant) {
> case RK808_ID:
> diff --git a/include/linux/mfd/rk808.h b/include/linux/mfd/rk808.h
> index 83701ef7d3c7..54feb140c210 100644
> --- a/include/linux/mfd/rk808.h
> +++ b/include/linux/mfd/rk808.h
> @@ -298,6 +298,7 @@ enum rk818_reg {
> #define VOUT_LO_INT BIT(0)
> #define CLK32KOUT2_EN BIT(0)
>
> +#define RK8XX_ID_MSK 0xfff0
> enum {
> BUCK_ILMIN_50MA,
> BUCK_ILMIN_100MA,
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-04-03 11:00 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-27 6:21 [PATCH v5 0/7] rk808: Add RK805 support Elaine Zhang
[not found] ` <1490595705-28844-1-git-send-email-zhangqing-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2017-03-27 6:21 ` [PATCH v5 1/7] mfd: rk808: fix up the chip id get failed Elaine Zhang
[not found] ` <1490595705-28844-2-git-send-email-zhangqing-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2017-04-03 11:00 ` Lee Jones [this message]
2017-03-27 6:21 ` [PATCH v5 2/7] mfd: rk808: add rk805 regs addr and ID Elaine Zhang
[not found] ` <1490595705-28844-3-git-send-email-zhangqing-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2017-04-03 11:04 ` Lee Jones
2017-03-27 6:21 ` [PATCH v5 3/7] regulator: rk808: Add regulator driver for RK805 Elaine Zhang
[not found] ` <1490595705-28844-4-git-send-email-zhangqing-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2017-03-27 9:40 ` Mark Brown
2017-03-27 6:21 ` [PATCH v5 4/7] mfd: rk808: Add RK805 support Elaine Zhang
2017-04-03 11:05 ` Lee Jones
2017-03-27 6:23 ` [PATCH v5 5/7] clk: Kconfig: Name RK805 in Kconfig for COMMON_CLK_RK808 Elaine Zhang
2017-03-27 6:23 ` [PATCH v5 6/7] rtc: Kconfig: Name RK805 in Kconfig for RTC_DRV_RK808 Elaine Zhang
2017-03-27 6:23 ` [PATCH v5 7/7] mfd: dt-bindings: Add RK805 device tree bindings document Elaine Zhang
2017-03-27 6:53 ` [PATCH RESEND " Elaine Zhang
[not found] ` <1490597615-852-1-git-send-email-zhangqing-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2017-03-31 18:53 ` Rob Herring
2017-04-03 11:06 ` Lee Jones
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=20170403110026.wutdgzz35h7h7l24@dell \
--to=lee.jones-qsej5fyqhm4dnm+yrofe0a@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=chenjh-TNX95d0MmH7DzftRWevZcw@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=huangtao-TNX95d0MmH7DzftRWevZcw@public.gmane.org \
--cc=lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=w.egorov-guT5V/WYfQezQB+pC5nmwQ@public.gmane.org \
--cc=xxx-TNX95d0MmH7DzftRWevZcw@public.gmane.org \
--cc=zhangqing-TNX95d0MmH7DzftRWevZcw@public.gmane.org \
/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