Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1607420
| From | Lee Jones <lee.jones@linaro.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v4 1/7] mfd: rk808: fix up the chip id get failed |
| Date | 2017-03-23 13:20 +0100 |
| Message-ID | <to9SF-25x-5@gated-at.bofh.it> (permalink) |
| References | <tlUbn-2o9-1@gated-at.bofh.it> <tlUbo-2o9-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Fri, 17 Mar 2017, Elaine Zhang wrote:
> the rk8xx chip id is:
> ((MSB << 8) | LSB) & 0xfff0
>
> Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
> ---
> drivers/mfd/rk808.c | 21 +++++++++++++++------
> include/linux/mfd/rk808.h | 1 +
> 2 files changed, 16 insertions(+), 6 deletions(-)
For my own reference:
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
> 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 */
> + 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",
> 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
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v4 0/7] rk808: Add RK805 support Elaine Zhang <zhangqing@rock-chips.com> - 2017-03-17 08:10 +0100
[PATCH v4 6/7] rtc: Kconfig: Name RK805 in Kconfig for RTC_DRV_RK808 Elaine Zhang <zhangqing@rock-chips.com> - 2017-03-17 08:10 +0100
[PATCH v4 7/7] mfd: dt-bindings: Add RK805 device tree bindings document Elaine Zhang <zhangqing@rock-chips.com> - 2017-03-17 08:10 +0100
Re: [PATCH v4 7/7] mfd: dt-bindings: Add RK805 device tree bindings document Lee Jones <lee.jones@linaro.org> - 2017-03-23 13:30 +0100
Re: [PATCH v4 7/7] mfd: dt-bindings: Add RK805 device tree bindings document Rob Herring <robh@kernel.org> - 2017-03-24 03:40 +0100
[PATCH v4 3/7] regulator: rk808: Add regulator driver for RK805 Elaine Zhang <zhangqing@rock-chips.com> - 2017-03-17 08:10 +0100
[PATCH v4 2/7] mfd: rk808: add rk805 regs addr and ID Elaine Zhang <zhangqing@rock-chips.com> - 2017-03-17 08:10 +0100
Re: [PATCH v4 2/7] mfd: rk808: add rk805 regs addr and ID Lee Jones <lee.jones@linaro.org> - 2017-03-23 13:20 +0100
Re: [PATCH v4 2/7] mfd: rk808: add rk805 regs addr and ID Elaine Zhang <zhangqing@rock-chips.com> - 2017-03-24 03:30 +0100
[PATCH v4 5/7] clk: Kconfig: Name RK805 in Kconfig for COMMON_CLK_RK808 Elaine Zhang <zhangqing@rock-chips.com> - 2017-03-17 08:10 +0100
[PATCH v4 1/7] mfd: rk808: fix up the chip id get failed Elaine Zhang <zhangqing@rock-chips.com> - 2017-03-17 08:10 +0100
Re: [PATCH v4 1/7] mfd: rk808: fix up the chip id get failed Lee Jones <lee.jones@linaro.org> - 2017-03-23 13:20 +0100
[PATCH v4 4/7] mfd: rk808: Add RK805 support Elaine Zhang <zhangqing@rock-chips.com> - 2017-03-17 08:10 +0100
Re: [PATCH v4 4/7] mfd: rk808: Add RK805 support kbuild test robot <lkp@intel.com> - 2017-03-20 01:30 +0100
Re: [PATCH v4 4/7] mfd: rk808: Add RK805 support Lee Jones <lee.jones@linaro.org> - 2017-03-23 13:30 +0100
Re: [PATCH v4 4/7] mfd: rk808: Add RK805 support Elaine Zhang <zhangqing@rock-chips.com> - 2017-03-24 03:40 +0100
csiph-web