diff for duplicates of <20160615160219.GP4948@dell> diff --git a/a/1.txt b/N1/1.txt index 4f2efec..bf5c8e5 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -11,7 +11,7 @@ On Mon, 13 Jun 2016, Wadim Egorov wrote: > Both RK808 and RK818 chips are using a similar register map, > so we can reuse the RTC and Clocking functionality. > -> Signed-off-by: Wadim Egorov <w.egorov@phytec.de> +> Signed-off-by: Wadim Egorov <w.egorov-guT5V/WYfQezQB+pC5nmwQ@public.gmane.org> > --- > Changes since v5: > - Few spell fixes in the commit description @@ -58,12 +58,12 @@ Applied, thanks. > * > * Copyright (c) 2014, Fuzhou Rockchip Electronics Co., Ltd > * -> * Author: Chris Zhong <zyw@rock-chips.com> -> * Author: Zhang Qing <zhangqing@rock-chips.com> +> * Author: Chris Zhong <zyw-TNX95d0MmH7DzftRWevZcw@public.gmane.org> +> * Author: Zhang Qing <zhangqing-TNX95d0MmH7DzftRWevZcw@public.gmane.org> > * > + * Copyright (C) 2016 PHYTEC Messtechnik GmbH > + * -> + * Author: Wadim Egorov <w.egorov@phytec.de> +> + * Author: Wadim Egorov <w.egorov-guT5V/WYfQezQB+pC5nmwQ@public.gmane.org> > + * > * This program is free software; you can redistribute it and/or modify it > * under the terms and conditions of the GNU General Public License, @@ -375,10 +375,10 @@ Applied, thanks. > MODULE_DEVICE_TABLE(i2c, rk808_ids); > @@ -272,4 +434,5 @@ module_i2c_driver(rk808_i2c_driver); > MODULE_LICENSE("GPL"); -> MODULE_AUTHOR("Chris Zhong <zyw@rock-chips.com>"); -> MODULE_AUTHOR("Zhang Qing <zhangqing@rock-chips.com>"); +> MODULE_AUTHOR("Chris Zhong <zyw-TNX95d0MmH7DzftRWevZcw@public.gmane.org>"); +> MODULE_AUTHOR("Zhang Qing <zhangqing-TNX95d0MmH7DzftRWevZcw@public.gmane.org>"); > -MODULE_DESCRIPTION("RK808 PMIC driver"); -> +MODULE_AUTHOR("Wadim Egorov <w.egorov@phytec.de>"); +> +MODULE_AUTHOR("Wadim Egorov <w.egorov-guT5V/WYfQezQB+pC5nmwQ@public.gmane.org>"); > +MODULE_DESCRIPTION("RK808/RK818 PMIC driver"); > diff --git a/include/linux/mfd/rk808.h b/include/linux/mfd/rk808.h > index 441b6ee..e5ae21d 100644 @@ -391,12 +391,12 @@ Applied, thanks. > * > * Copyright (c) 2014, Fuzhou Rockchip Electronics Co., Ltd > * -> * Author: Chris Zhong <zyw@rock-chips.com> -> * Author: Zhang Qing <zhangqing@rock-chips.com> +> * Author: Chris Zhong <zyw-TNX95d0MmH7DzftRWevZcw@public.gmane.org> +> * Author: Zhang Qing <zhangqing-TNX95d0MmH7DzftRWevZcw@public.gmane.org> > * > + * Copyright (C) 2016 PHYTEC Messtechnik GmbH > + * -> + * Author: Wadim Egorov <w.egorov@phytec.de> +> + * Author: Wadim Egorov <w.egorov-guT5V/WYfQezQB+pC5nmwQ@public.gmane.org> > + * > * This program is free software; you can redistribute it and/or modify it > * under the terms and conditions of the GNU General Public License, @@ -587,3 +587,13 @@ Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog + +-- +You received this message because you are subscribed to "rtc-linux". +Membership options at http://groups.google.com/group/rtc-linux . +Please read http://groups.google.com/group/rtc-linux/web/checklist +before submitting a driver. +--- +You received this message because you are subscribed to the Google Groups "rtc-linux" group. +To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org +For more options, visit https://groups.google.com/d/optout. diff --git a/a/content_digest b/N1/content_digest index 9843748..8adc354 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,23 +1,24 @@ "ref\01465803989-33632-1-git-send-email-w.egorov@phytec.de\0" - "From\0Lee Jones <lee.jones@linaro.org>\0" + "ref\01465803989-33632-1-git-send-email-w.egorov-guT5V/WYfQezQB+pC5nmwQ@public.gmane.org\0" + "From\0Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>\0" "Subject\0Re: [PATCH v6 1/5] mfd: RK808: Add RK818 support\0" "Date\0Wed, 15 Jun 2016 17:02:19 +0100\0" - "To\0Wadim Egorov <w.egorov@phytec.de>\0" - "Cc\0linux-kernel@vger.kernel.org" - linux-clk@vger.kernel.org - rtc-linux@googlegroups.com - devicetree@vger.kernel.org - linux-rockchip@lists.infradead.org - robh+dt@kernel.org - mark.rutland@arm.com - mturquette@baylibre.com - sboyd@codeaurora.org - lgirdwood@gmail.com - broonie@kernel.org - a.zummo@towertech.it - alexandre.belloni@free-electrons.com - dianders@chromium.org - " zyw@rock-chips.com\0" + "To\0Wadim Egorov <w.egorov-guT5V/WYfQezQB+pC5nmwQ@public.gmane.org>\0" + "Cc\0linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" + linux-clk-u79uwXL29TY76Z2rM5mHXA@public.gmane.org + rtc-linux-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org + devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org + linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org + robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org + mark.rutland-5wv7dgnIgG8@public.gmane.org + mturquette-rdvid1DuHRBWk0Htik3J/w@public.gmane.org + sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org + lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org + broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org + a.zummo-BfzFCNDTiLLj+vYz1yj4TQ@public.gmane.org + alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org + dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org + " zyw-TNX95d0MmH7DzftRWevZcw@public.gmane.org\0" "\00:1\0" "b\0" "On Mon, 13 Jun 2016, Wadim Egorov wrote:\n" @@ -33,7 +34,7 @@ "> Both RK808 and RK818 chips are using a similar register map,\n" "> so we can reuse the RTC and Clocking functionality.\n" "> \n" - "> Signed-off-by: Wadim Egorov <w.egorov@phytec.de>\n" + "> Signed-off-by: Wadim Egorov <w.egorov-guT5V/WYfQezQB+pC5nmwQ@public.gmane.org>\n" "> ---\n" "> Changes since v5:\n" "> - Few spell fixes in the commit description\n" @@ -80,12 +81,12 @@ "> *\n" "> * Copyright (c) 2014, Fuzhou Rockchip Electronics Co., Ltd\n" "> *\n" - "> * Author: Chris Zhong <zyw@rock-chips.com>\n" - "> * Author: Zhang Qing <zhangqing@rock-chips.com>\n" + "> * Author: Chris Zhong <zyw-TNX95d0MmH7DzftRWevZcw@public.gmane.org>\n" + "> * Author: Zhang Qing <zhangqing-TNX95d0MmH7DzftRWevZcw@public.gmane.org>\n" "> *\n" "> + * Copyright (C) 2016 PHYTEC Messtechnik GmbH\n" "> + *\n" - "> + * Author: Wadim Egorov <w.egorov@phytec.de>\n" + "> + * Author: Wadim Egorov <w.egorov-guT5V/WYfQezQB+pC5nmwQ@public.gmane.org>\n" "> + *\n" "> * This program is free software; you can redistribute it and/or modify it\n" "> * under the terms and conditions of the GNU General Public License,\n" @@ -397,10 +398,10 @@ "> MODULE_DEVICE_TABLE(i2c, rk808_ids);\n" "> @@ -272,4 +434,5 @@ module_i2c_driver(rk808_i2c_driver);\n" "> MODULE_LICENSE(\"GPL\");\n" - "> MODULE_AUTHOR(\"Chris Zhong <zyw@rock-chips.com>\");\n" - "> MODULE_AUTHOR(\"Zhang Qing <zhangqing@rock-chips.com>\");\n" + "> MODULE_AUTHOR(\"Chris Zhong <zyw-TNX95d0MmH7DzftRWevZcw@public.gmane.org>\");\n" + "> MODULE_AUTHOR(\"Zhang Qing <zhangqing-TNX95d0MmH7DzftRWevZcw@public.gmane.org>\");\n" "> -MODULE_DESCRIPTION(\"RK808 PMIC driver\");\n" - "> +MODULE_AUTHOR(\"Wadim Egorov <w.egorov@phytec.de>\");\n" + "> +MODULE_AUTHOR(\"Wadim Egorov <w.egorov-guT5V/WYfQezQB+pC5nmwQ@public.gmane.org>\");\n" "> +MODULE_DESCRIPTION(\"RK808/RK818 PMIC driver\");\n" "> diff --git a/include/linux/mfd/rk808.h b/include/linux/mfd/rk808.h\n" "> index 441b6ee..e5ae21d 100644\n" @@ -413,12 +414,12 @@ "> *\n" "> * Copyright (c) 2014, Fuzhou Rockchip Electronics Co., Ltd\n" "> *\n" - "> * Author: Chris Zhong <zyw@rock-chips.com>\n" - "> * Author: Zhang Qing <zhangqing@rock-chips.com>\n" + "> * Author: Chris Zhong <zyw-TNX95d0MmH7DzftRWevZcw@public.gmane.org>\n" + "> * Author: Zhang Qing <zhangqing-TNX95d0MmH7DzftRWevZcw@public.gmane.org>\n" "> *\n" "> + * Copyright (C) 2016 PHYTEC Messtechnik GmbH\n" "> + *\n" - "> + * Author: Wadim Egorov <w.egorov@phytec.de>\n" + "> + * Author: Wadim Egorov <w.egorov-guT5V/WYfQezQB+pC5nmwQ@public.gmane.org>\n" "> + *\n" "> * This program is free software; you can redistribute it and/or modify it\n" "> * under the terms and conditions of the GNU General Public License,\n" @@ -608,6 +609,16 @@ "Lee Jones\n" "Linaro STMicroelectronics Landing Team Lead\n" "Linaro.org \342\224\202 Open source software for ARM SoCs\n" - Follow Linaro: Facebook | Twitter | Blog + "Follow Linaro: Facebook | Twitter | Blog\n" + "\n" + "-- \n" + "You received this message because you are subscribed to \"rtc-linux\".\n" + "Membership options at http://groups.google.com/group/rtc-linux .\n" + "Please read http://groups.google.com/group/rtc-linux/web/checklist\n" + "before submitting a driver.\n" + "--- \n" + "You received this message because you are subscribed to the Google Groups \"rtc-linux\" group.\n" + "To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org\n" + For more options, visit https://groups.google.com/d/optout. -193693ec4d8a54a9610ade1533db967bf4e2b46f6d54b689e0fc523901b59d7d +18c4080a26d73ddb0cef75d69ac6bb39e2a93b2df54bb3d5ecf84f2e9dcfae1e
diff --git a/a/1.txt b/N2/1.txt index 4f2efec..33e7cc9 100644 --- a/a/1.txt +++ b/N2/1.txt @@ -1,16 +1,17 @@ On Mon, 13 Jun 2016, Wadim Egorov wrote: -> The RK818 chip is a Power Management IC (PMIC) for multimedia and handheld +> The RK818 chip is a Power Management IC (PMIC) for multimedia and handhel= +d > devices. It contains the following components: -> +>=20 > - Regulators > - RTC > - Clocking > - Battery support -> +>=20 > Both RK808 and RK818 chips are using a similar register map, > so we can reuse the RTC and Clocking functionality. -> +>=20 > Signed-off-by: Wadim Egorov <w.egorov@phytec.de> > --- > Changes since v5: @@ -21,7 +22,8 @@ On Mon, 13 Jun 2016, Wadim Egorov wrote: > - Moved of_match_device and variant determination to probe > --- > drivers/mfd/Kconfig | 4 +- -> drivers/mfd/rk808.c | 225 +++++++++++++++++++++++++++++++++++++++------- +> drivers/mfd/rk808.c | 225 +++++++++++++++++++++++++++++++++++++++-= +------ > include/linux/mfd/rk808.h | 152 +++++++++++++++++++++++++++++-- > 3 files changed, 339 insertions(+), 42 deletions(-) @@ -33,7 +35,7 @@ Applied, thanks. > +++ b/drivers/mfd/Kconfig > @@ -839,13 +839,13 @@ config MFD_RC5T583 > different functionality of the device. -> +> =20 > config MFD_RK808 > - tristate "Rockchip RK808 Power Management chip" > + tristate "Rockchip RK808/RK818 Power Management Chip" @@ -65,7 +67,8 @@ Applied, thanks. > + * > + * Author: Wadim Egorov <w.egorov@phytec.de> > + * -> * This program is free software; you can redistribute it and/or modify it +> * This program is free software; you can redistribute it and/or modify = +it > * under the terms and conditions of the GNU General Public License, > * version 2, as published by the Free Software Foundation. > @@ -22,6 +26,7 @@ @@ -73,53 +76,55 @@ Applied, thanks. > #include <linux/module.h> > #include <linux/regmap.h> > +#include <linux/of_device.h> -> +> =20 > struct rk808_reg_data { > int addr; -> @@ -57,6 +62,14 @@ static bool rk808_is_volatile_reg(struct device *dev, unsigned int reg) +> @@ -57,6 +62,14 @@ static bool rk808_is_volatile_reg(struct device *dev, = +unsigned int reg) > return false; > } -> -> +static const struct regmap_config rk818_regmap_config = { -> + .reg_bits = 8, -> + .val_bits = 8, -> + .max_register = RK818_USB_CTRL_REG, -> + .cache_type = REGCACHE_RBTREE, -> + .volatile_reg = rk808_is_volatile_reg, +> =20 +> +static const struct regmap_config rk818_regmap_config =3D { +> + .reg_bits =3D 8, +> + .val_bits =3D 8, +> + .max_register =3D RK818_USB_CTRL_REG, +> + .cache_type =3D REGCACHE_RBTREE, +> + .volatile_reg =3D rk808_is_volatile_reg, > +}; > + -> static const struct regmap_config rk808_regmap_config = { -> .reg_bits = 8, -> .val_bits = 8, -> @@ -79,11 +92,21 @@ static const struct mfd_cell rk808s[] = { +> static const struct regmap_config rk808_regmap_config =3D { +> .reg_bits =3D 8, +> .val_bits =3D 8, +> @@ -79,11 +92,21 @@ static const struct mfd_cell rk808s[] =3D { > { -> .name = "rk808-rtc", -> .num_resources = ARRAY_SIZE(rtc_resources), -> - .resources = &rtc_resources[0], -> + .resources = rtc_resources, +> .name =3D "rk808-rtc", +> .num_resources =3D ARRAY_SIZE(rtc_resources), +> - .resources =3D &rtc_resources[0], +> + .resources =3D rtc_resources, > }, > }; -> -> -static const struct rk808_reg_data pre_init_reg[] = { -> +static const struct mfd_cell rk818s[] = { -> + { .name = "rk808-clkout", }, -> + { .name = "rk808-regulator", }, +> =20 +> -static const struct rk808_reg_data pre_init_reg[] =3D { +> +static const struct mfd_cell rk818s[] =3D { +> + { .name =3D "rk808-clkout", }, +> + { .name =3D "rk808-regulator", }, > + { -> + .name = "rk808-rtc", -> + .num_resources = ARRAY_SIZE(rtc_resources), -> + .resources = rtc_resources, +> + .name =3D "rk808-rtc", +> + .num_resources =3D ARRAY_SIZE(rtc_resources), +> + .resources =3D rtc_resources, > + }, > +}; > + -> +static const struct rk808_reg_data rk808_pre_init_reg[] = { +> +static const struct rk808_reg_data rk808_pre_init_reg[] =3D { > { RK808_BUCK3_CONFIG_REG, BUCK_ILMIN_MASK, BUCK_ILMIN_150MA }, > { RK808_BUCK4_CONFIG_REG, BUCK_ILMIN_MASK, BUCK_ILMIN_200MA }, > { RK808_BOOST_CONFIG_REG, BOOST_ILMIN_MASK, BOOST_ILMIN_100MA }, -> @@ -94,6 +117,24 @@ static const struct rk808_reg_data pre_init_reg[] = { +> @@ -94,6 +117,24 @@ static const struct rk808_reg_data pre_init_reg[] =3D= + { > VB_LO_SEL_3500MV }, > }; -> -> +static const struct rk808_reg_data rk818_pre_init_reg[] = { +> =20 +> +static const struct rk808_reg_data rk818_pre_init_reg[] =3D { > + /* improve efficiency */ > + { RK818_BUCK2_CONFIG_REG, BUCK2_RATE_MASK, BUCK_ILMIN_250MA }, > + { RK818_BUCK4_CONFIG_REG, BUCK_ILMIN_MASK, BUCK_ILMIN_250MA }, @@ -137,100 +142,100 @@ Applied, thanks. > + VB_LO_SEL_3500MV }, > +}; > + -> static const struct regmap_irq rk808_irqs[] = { +> static const struct regmap_irq rk808_irqs[] =3D { > /* INT_STS */ -> [RK808_IRQ_VOUT_LO] = { -> @@ -136,6 +177,76 @@ static const struct regmap_irq rk808_irqs[] = { +> [RK808_IRQ_VOUT_LO] =3D { +> @@ -136,6 +177,76 @@ static const struct regmap_irq rk808_irqs[] =3D { > }, > }; -> -> +static const struct regmap_irq rk818_irqs[] = { +> =20 +> +static const struct regmap_irq rk818_irqs[] =3D { > + /* INT_STS */ -> + [RK818_IRQ_VOUT_LO] = { -> + .mask = RK818_IRQ_VOUT_LO_MSK, -> + .reg_offset = 0, +> + [RK818_IRQ_VOUT_LO] =3D { +> + .mask =3D RK818_IRQ_VOUT_LO_MSK, +> + .reg_offset =3D 0, > + }, -> + [RK818_IRQ_VB_LO] = { -> + .mask = RK818_IRQ_VB_LO_MSK, -> + .reg_offset = 0, +> + [RK818_IRQ_VB_LO] =3D { +> + .mask =3D RK818_IRQ_VB_LO_MSK, +> + .reg_offset =3D 0, > + }, -> + [RK818_IRQ_PWRON] = { -> + .mask = RK818_IRQ_PWRON_MSK, -> + .reg_offset = 0, +> + [RK818_IRQ_PWRON] =3D { +> + .mask =3D RK818_IRQ_PWRON_MSK, +> + .reg_offset =3D 0, > + }, -> + [RK818_IRQ_PWRON_LP] = { -> + .mask = RK818_IRQ_PWRON_LP_MSK, -> + .reg_offset = 0, +> + [RK818_IRQ_PWRON_LP] =3D { +> + .mask =3D RK818_IRQ_PWRON_LP_MSK, +> + .reg_offset =3D 0, > + }, -> + [RK818_IRQ_HOTDIE] = { -> + .mask = RK818_IRQ_HOTDIE_MSK, -> + .reg_offset = 0, +> + [RK818_IRQ_HOTDIE] =3D { +> + .mask =3D RK818_IRQ_HOTDIE_MSK, +> + .reg_offset =3D 0, > + }, -> + [RK818_IRQ_RTC_ALARM] = { -> + .mask = RK818_IRQ_RTC_ALARM_MSK, -> + .reg_offset = 0, +> + [RK818_IRQ_RTC_ALARM] =3D { +> + .mask =3D RK818_IRQ_RTC_ALARM_MSK, +> + .reg_offset =3D 0, > + }, -> + [RK818_IRQ_RTC_PERIOD] = { -> + .mask = RK818_IRQ_RTC_PERIOD_MSK, -> + .reg_offset = 0, +> + [RK818_IRQ_RTC_PERIOD] =3D { +> + .mask =3D RK818_IRQ_RTC_PERIOD_MSK, +> + .reg_offset =3D 0, > + }, -> + [RK818_IRQ_USB_OV] = { -> + .mask = RK818_IRQ_USB_OV_MSK, -> + .reg_offset = 0, +> + [RK818_IRQ_USB_OV] =3D { +> + .mask =3D RK818_IRQ_USB_OV_MSK, +> + .reg_offset =3D 0, > + }, > + > + /* INT_STS2 */ -> + [RK818_IRQ_PLUG_IN] = { -> + .mask = RK818_IRQ_PLUG_IN_MSK, -> + .reg_offset = 1, +> + [RK818_IRQ_PLUG_IN] =3D { +> + .mask =3D RK818_IRQ_PLUG_IN_MSK, +> + .reg_offset =3D 1, > + }, -> + [RK818_IRQ_PLUG_OUT] = { -> + .mask = RK818_IRQ_PLUG_OUT_MSK, -> + .reg_offset = 1, +> + [RK818_IRQ_PLUG_OUT] =3D { +> + .mask =3D RK818_IRQ_PLUG_OUT_MSK, +> + .reg_offset =3D 1, > + }, -> + [RK818_IRQ_CHG_OK] = { -> + .mask = RK818_IRQ_CHG_OK_MSK, -> + .reg_offset = 1, +> + [RK818_IRQ_CHG_OK] =3D { +> + .mask =3D RK818_IRQ_CHG_OK_MSK, +> + .reg_offset =3D 1, > + }, -> + [RK818_IRQ_CHG_TE] = { -> + .mask = RK818_IRQ_CHG_TE_MSK, -> + .reg_offset = 1, +> + [RK818_IRQ_CHG_TE] =3D { +> + .mask =3D RK818_IRQ_CHG_TE_MSK, +> + .reg_offset =3D 1, > + }, -> + [RK818_IRQ_CHG_TS1] = { -> + .mask = RK818_IRQ_CHG_TS1_MSK, -> + .reg_offset = 1, +> + [RK818_IRQ_CHG_TS1] =3D { +> + .mask =3D RK818_IRQ_CHG_TS1_MSK, +> + .reg_offset =3D 1, > + }, -> + [RK818_IRQ_TS2] = { -> + .mask = RK818_IRQ_TS2_MSK, -> + .reg_offset = 1, +> + [RK818_IRQ_TS2] =3D { +> + .mask =3D RK818_IRQ_TS2_MSK, +> + .reg_offset =3D 1, > + }, -> + [RK818_IRQ_CHG_CVTLIM] = { -> + .mask = RK818_IRQ_CHG_CVTLIM_MSK, -> + .reg_offset = 1, +> + [RK818_IRQ_CHG_CVTLIM] =3D { +> + .mask =3D RK818_IRQ_CHG_CVTLIM_MSK, +> + .reg_offset =3D 1, > + }, -> + [RK818_IRQ_DISCHG_ILIM] = { -> + .mask = RK818_IRQ_DISCHG_ILIM_MSK, -> + .reg_offset = 1, +> + [RK818_IRQ_DISCHG_ILIM] =3D { +> + .mask =3D RK818_IRQ_DISCHG_ILIM_MSK, +> + .reg_offset =3D 1, > + }, > +}; > + -> static struct regmap_irq_chip rk808_irq_chip = { -> .name = "rk808", -> .irqs = rk808_irqs, -> @@ -148,6 +259,18 @@ static struct regmap_irq_chip rk808_irq_chip = { -> .init_ack_masked = true, +> static struct regmap_irq_chip rk808_irq_chip =3D { +> .name =3D "rk808", +> .irqs =3D rk808_irqs, +> @@ -148,6 +259,18 @@ static struct regmap_irq_chip rk808_irq_chip =3D { +> .init_ack_masked =3D true, > }; -> -> +static struct regmap_irq_chip rk818_irq_chip = { -> + .name = "rk818", -> + .irqs = rk818_irqs, -> + .num_irqs = ARRAY_SIZE(rk818_irqs), -> + .num_regs = 2, -> + .irq_reg_stride = 2, -> + .status_base = RK818_INT_STS_REG1, -> + .mask_base = RK818_INT_STS_MSK_REG1, -> + .ack_base = RK818_INT_STS_REG1, -> + .init_ack_masked = true, +> =20 +> +static struct regmap_irq_chip rk818_irq_chip =3D { +> + .name =3D "rk818", +> + .irqs =3D rk818_irqs, +> + .num_irqs =3D ARRAY_SIZE(rk818_irqs), +> + .num_regs =3D 2, +> + .irq_reg_stride =3D 2, +> + .status_base =3D RK818_INT_STS_REG1, +> + .mask_base =3D RK818_INT_STS_MSK_REG1, +> + .ack_base =3D RK818_INT_STS_REG1, +> + .init_ack_masked =3D true, > +}; > + > static struct i2c_client *rk808_i2c_client; @@ -239,10 +244,10 @@ Applied, thanks. > @@ -167,55 +290,99 @@ static void rk808_device_shutdown(void) > dev_err(&rk808_i2c_client->dev, "power off error!\n"); > } -> -> +static const struct of_device_id rk808_of_match[] = { -> + { .compatible = "rockchip,rk808", .data = (void *) RK808_ID }, -> + { .compatible = "rockchip,rk818", .data = (void *) RK818_ID }, +> =20 +> +static const struct of_device_id rk808_of_match[] =3D { +> + { .compatible =3D "rockchip,rk808", .data =3D (void *) RK808_ID }, +> + { .compatible =3D "rockchip,rk818", .data =3D (void *) RK818_ID }, > + { }, > +}; > +MODULE_DEVICE_TABLE(of, rk808_of_match); @@ -250,50 +255,50 @@ Applied, thanks. > static int rk808_probe(struct i2c_client *client, > const struct i2c_device_id *id) > { -> struct device_node *np = client->dev.of_node; +> struct device_node *np =3D client->dev.of_node; > struct rk808 *rk808; > + const struct of_device_id *match; > + const struct rk808_reg_data *pre_init_reg; > + const struct mfd_cell *cells; > + int nr_pre_init_regs; > + int nr_cells; -> int pm_off = 0; +> int pm_off =3D 0; > int ret; > int i; -> +> =20 > - if (!client->irq) { > - dev_err(&client->dev, "No interrupt support, no core IRQ\n"); > - return -EINVAL; > - } > - -> rk808 = devm_kzalloc(&client->dev, sizeof(*rk808), GFP_KERNEL); +> rk808 =3D devm_kzalloc(&client->dev, sizeof(*rk808), GFP_KERNEL); > if (!rk808) > return -ENOMEM; -> -> - rk808->regmap = devm_regmap_init_i2c(client, &rk808_regmap_config); -> + match = of_match_device(rk808_of_match, &client->dev); +> =20 +> - rk808->regmap =3D devm_regmap_init_i2c(client, &rk808_regmap_config); +> + match =3D of_match_device(rk808_of_match, &client->dev); > + if (!match) { > + dev_err(&client->dev, "Unable to match OF ID\n"); > + return -ENODEV; > + } -> + rk808->variant = (long)match->data; +> + rk808->variant =3D (long)match->data; > + > + switch (rk808->variant) { > + case RK808_ID: -> + rk808->regmap_cfg = &rk808_regmap_config; -> + rk808->regmap_irq_chip = &rk808_irq_chip; -> + pre_init_reg = rk808_pre_init_reg; -> + nr_pre_init_regs = ARRAY_SIZE(rk808_pre_init_reg); -> + cells = rk808s; -> + nr_cells = ARRAY_SIZE(rk808s); +> + rk808->regmap_cfg =3D &rk808_regmap_config; +> + rk808->regmap_irq_chip =3D &rk808_irq_chip; +> + pre_init_reg =3D rk808_pre_init_reg; +> + nr_pre_init_regs =3D ARRAY_SIZE(rk808_pre_init_reg); +> + cells =3D rk808s; +> + nr_cells =3D ARRAY_SIZE(rk808s); > + break; > + case RK818_ID: -> + rk808->regmap_cfg = &rk818_regmap_config; -> + rk808->regmap_irq_chip = &rk818_irq_chip; -> + pre_init_reg = rk818_pre_init_reg; -> + nr_pre_init_regs = ARRAY_SIZE(rk818_pre_init_reg); -> + cells = rk818s; -> + nr_cells = ARRAY_SIZE(rk818s); +> + rk808->regmap_cfg =3D &rk818_regmap_config; +> + rk808->regmap_irq_chip =3D &rk818_irq_chip; +> + pre_init_reg =3D rk818_pre_init_reg; +> + nr_pre_init_regs =3D ARRAY_SIZE(rk818_pre_init_reg); +> + cells =3D rk818s; +> + nr_cells =3D ARRAY_SIZE(rk818s); > + break; > + default: > + dev_err(&client->dev, "Unsupported RK8XX ID %lu\n", @@ -301,17 +306,17 @@ Applied, thanks. > + return -EINVAL; > + } > + -> + rk808->i2c = client; +> + rk808->i2c =3D client; > + i2c_set_clientdata(client, rk808); > + -> + rk808->regmap = devm_regmap_init_i2c(client, rk808->regmap_cfg); +> + rk808->regmap =3D devm_regmap_init_i2c(client, rk808->regmap_cfg); > if (IS_ERR(rk808->regmap)) { > dev_err(&client->dev, "regmap initialization failed\n"); > return PTR_ERR(rk808->regmap); > } -> -> - for (i = 0; i < ARRAY_SIZE(pre_init_reg); i++) { -> - ret = regmap_update_bits(rk808->regmap, pre_init_reg[i].addr, +> =20 +> - for (i =3D 0; i < ARRAY_SIZE(pre_init_reg); i++) { +> - ret =3D regmap_update_bits(rk808->regmap, pre_init_reg[i].addr, > - pre_init_reg[i].mask, > - pre_init_reg[i].value); > - if (ret) { @@ -323,8 +328,8 @@ Applied, thanks. > + dev_err(&client->dev, "No interrupt support, no core IRQ\n"); > + return -EINVAL; > } -> -> ret = regmap_add_irq_chip(rk808->regmap, client->irq, +> =20 +> ret =3D regmap_add_irq_chip(rk808->regmap, client->irq, > IRQF_ONESHOT, -1, > - &rk808_irq_chip, &rk808->irq_data); > + rk808->regmap_irq_chip, &rk808->irq_data); @@ -332,11 +337,11 @@ Applied, thanks. > dev_err(&client->dev, "Failed to add irq_chip %d\n", ret); > return ret; > } -> -> - rk808->i2c = client; +> =20 +> - rk808->i2c =3D client; > - i2c_set_clientdata(client, rk808); -> + for (i = 0; i < nr_pre_init_regs; i++) { -> + ret = regmap_update_bits(rk808->regmap, +> + for (i =3D 0; i < nr_pre_init_regs; i++) { +> + ret =3D regmap_update_bits(rk808->regmap, > + pre_init_reg[i].addr, > + pre_init_reg[i].mask, > + pre_init_reg[i].value); @@ -347,11 +352,11 @@ Applied, thanks. > + return ret; > + } > + } -> -> - ret = devm_mfd_add_devices(&client->dev, -1, +> =20 +> - ret =3D devm_mfd_add_devices(&client->dev, -1, > - rk808s, ARRAY_SIZE(rk808s), NULL, 0, > - regmap_irq_get_domain(rk808->irq_data)); -> + ret = devm_mfd_add_devices(&client->dev, PLATFORM_DEVID_NONE, +> + ret =3D devm_mfd_add_devices(&client->dev, PLATFORM_DEVID_NONE, > + cells, nr_cells, NULL, 0, > + regmap_irq_get_domain(rk808->irq_data)); > if (ret) { @@ -360,14 +365,14 @@ Applied, thanks. > @@ -245,14 +412,9 @@ static int rk808_remove(struct i2c_client *client) > return 0; > } -> -> -static const struct of_device_id rk808_of_match[] = { -> - { .compatible = "rockchip,rk808" }, +> =20 +> -static const struct of_device_id rk808_of_match[] =3D { +> - { .compatible =3D "rockchip,rk808" }, > - { }, > -}; > -MODULE_DEVICE_TABLE(of, rk808_of_match); > - -> static const struct i2c_device_id rk808_ids[] = { +> static const struct i2c_device_id rk808_ids[] =3D { > { "rk808" }, > + { "rk818" }, > { }, @@ -398,33 +403,34 @@ Applied, thanks. > + * > + * Author: Wadim Egorov <w.egorov@phytec.de> > + * -> * This program is free software; you can redistribute it and/or modify it +> * This program is free software; you can redistribute it and/or modify = +it > * under the terms and conditions of the GNU General Public License, > * version 2, as published by the Free Software Foundation. > @@ -16,8 +20,8 @@ > * more details. > */ -> +> =20 > -#ifndef __LINUX_REGULATOR_rk808_H > -#define __LINUX_REGULATOR_rk808_H > +#ifndef __LINUX_REGULATOR_RK808_H > +#define __LINUX_REGULATOR_RK808_H -> +> =20 > #include <linux/regulator/machine.h> > #include <linux/regmap.h> > @@ -28,7 +32,7 @@ -> +> =20 > #define RK808_DCDC1 0 /* (0+RK808_START) */ > #define RK808_LDO1 4 /* (4+RK808_START) */ > -#define RK808_NUM_REGULATORS 14 > +#define RK808_NUM_REGULATORS 14 -> +> =20 > enum rk808_reg { > RK808_ID_DCDC1, > @@ -115,7 +119,92 @@ enum rk808_reg { > #define RK808_INT_STS_MSK_REG2 0x4f > #define RK808_IO_POL_REG 0x50 -> +> =20 > -/* IRQ Definitions */ > +/* RK818 */ > +#define RK818_DCDC1 0 @@ -518,7 +524,7 @@ Applied, thanks. > @@ -137,6 +226,43 @@ enum rk808_reg { > #define RK808_IRQ_PLUG_IN_INT_MSK BIT(0) > #define RK808_IRQ_PLUG_OUT_INT_MSK BIT(1) -> +> =20 > +/* RK818 IRQ Definitions */ > +#define RK818_IRQ_VOUT_LO 0 > +#define RK818_IRQ_VB_LO 1 @@ -562,7 +568,7 @@ Applied, thanks. > @@ -191,9 +317,17 @@ enum { > BOOST_ILMIN_250MA, > }; -> +> =20 > +enum { > + RK808_ID, > + RK818_ID, @@ -582,8 +588,20 @@ Applied, thanks. > -#endif /* __LINUX_REGULATOR_rk808_H */ > +#endif /* __LINUX_REGULATOR_RK808_H */ --- +--=20 Lee Jones Linaro STMicroelectronics Landing Team Lead -Linaro.org │ Open source software for ARM SoCs +Linaro.org =E2=94=82 Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog + +--=20 +You received this message because you are subscribed to "rtc-linux". +Membership options at http://groups.google.com/group/rtc-linux . +Please read http://groups.google.com/group/rtc-linux/web/checklist +before submitting a driver. +---=20 +You received this message because you are subscribed to the Google Groups "= +rtc-linux" group. +To unsubscribe from this group and stop receiving emails from it, send an e= +mail to rtc-linux+unsubscribe@googlegroups.com. +For more options, visit https://groups.google.com/d/optout. diff --git a/a/content_digest b/N2/content_digest index 9843748..2816877 100644 --- a/a/content_digest +++ b/N2/content_digest @@ -1,6 +1,6 @@ "ref\01465803989-33632-1-git-send-email-w.egorov@phytec.de\0" "From\0Lee Jones <lee.jones@linaro.org>\0" - "Subject\0Re: [PATCH v6 1/5] mfd: RK808: Add RK818 support\0" + "Subject\0[rtc-linux] Re: [PATCH v6 1/5] mfd: RK808: Add RK818 support\0" "Date\0Wed, 15 Jun 2016 17:02:19 +0100\0" "To\0Wadim Egorov <w.egorov@phytec.de>\0" "Cc\0linux-kernel@vger.kernel.org" @@ -22,17 +22,18 @@ "b\0" "On Mon, 13 Jun 2016, Wadim Egorov wrote:\n" "\n" - "> The RK818 chip is a Power Management IC (PMIC) for multimedia and handheld\n" + "> The RK818 chip is a Power Management IC (PMIC) for multimedia and handhel=\n" + "d\n" "> devices. It contains the following components:\n" - "> \n" + ">=20\n" "> - Regulators\n" "> - RTC\n" "> - Clocking\n" "> - Battery support\n" - "> \n" + ">=20\n" "> Both RK808 and RK818 chips are using a similar register map,\n" "> so we can reuse the RTC and Clocking functionality.\n" - "> \n" + ">=20\n" "> Signed-off-by: Wadim Egorov <w.egorov@phytec.de>\n" "> ---\n" "> Changes since v5:\n" @@ -43,7 +44,8 @@ "> - Moved of_match_device and variant determination to probe\n" "> ---\n" "> drivers/mfd/Kconfig | 4 +-\n" - "> drivers/mfd/rk808.c | 225 +++++++++++++++++++++++++++++++++++++++-------\n" + "> drivers/mfd/rk808.c | 225 +++++++++++++++++++++++++++++++++++++++-=\n" + "------\n" "> include/linux/mfd/rk808.h | 152 +++++++++++++++++++++++++++++--\n" "> 3 files changed, 339 insertions(+), 42 deletions(-)\n" "\n" @@ -55,7 +57,7 @@ "> +++ b/drivers/mfd/Kconfig\n" "> @@ -839,13 +839,13 @@ config MFD_RC5T583\n" "> \t different functionality of the device.\n" - "> \n" + "> =20\n" "> config MFD_RK808\n" "> -\ttristate \"Rockchip RK808 Power Management chip\"\n" "> +\ttristate \"Rockchip RK808/RK818 Power Management Chip\"\n" @@ -87,7 +89,8 @@ "> + *\n" "> + * Author: Wadim Egorov <w.egorov@phytec.de>\n" "> + *\n" - "> * This program is free software; you can redistribute it and/or modify it\n" + "> * This program is free software; you can redistribute it and/or modify =\n" + "it\n" "> * under the terms and conditions of the GNU General Public License,\n" "> * version 2, as published by the Free Software Foundation.\n" "> @@ -22,6 +26,7 @@\n" @@ -95,53 +98,55 @@ "> #include <linux/module.h>\n" "> #include <linux/regmap.h>\n" "> +#include <linux/of_device.h>\n" - "> \n" + "> =20\n" "> struct rk808_reg_data {\n" "> \tint addr;\n" - "> @@ -57,6 +62,14 @@ static bool rk808_is_volatile_reg(struct device *dev, unsigned int reg)\n" + "> @@ -57,6 +62,14 @@ static bool rk808_is_volatile_reg(struct device *dev, =\n" + "unsigned int reg)\n" "> \treturn false;\n" "> }\n" - "> \n" - "> +static const struct regmap_config rk818_regmap_config = {\n" - "> +\t.reg_bits = 8,\n" - "> +\t.val_bits = 8,\n" - "> +\t.max_register = RK818_USB_CTRL_REG,\n" - "> +\t.cache_type = REGCACHE_RBTREE,\n" - "> +\t.volatile_reg = rk808_is_volatile_reg,\n" + "> =20\n" + "> +static const struct regmap_config rk818_regmap_config =3D {\n" + "> +\t.reg_bits =3D 8,\n" + "> +\t.val_bits =3D 8,\n" + "> +\t.max_register =3D RK818_USB_CTRL_REG,\n" + "> +\t.cache_type =3D REGCACHE_RBTREE,\n" + "> +\t.volatile_reg =3D rk808_is_volatile_reg,\n" "> +};\n" "> +\n" - "> static const struct regmap_config rk808_regmap_config = {\n" - "> \t.reg_bits = 8,\n" - "> \t.val_bits = 8,\n" - "> @@ -79,11 +92,21 @@ static const struct mfd_cell rk808s[] = {\n" + "> static const struct regmap_config rk808_regmap_config =3D {\n" + "> \t.reg_bits =3D 8,\n" + "> \t.val_bits =3D 8,\n" + "> @@ -79,11 +92,21 @@ static const struct mfd_cell rk808s[] =3D {\n" "> \t{\n" - "> \t\t.name = \"rk808-rtc\",\n" - "> \t\t.num_resources = ARRAY_SIZE(rtc_resources),\n" - "> -\t\t.resources = &rtc_resources[0],\n" - "> +\t\t.resources = rtc_resources,\n" + "> \t\t.name =3D \"rk808-rtc\",\n" + "> \t\t.num_resources =3D ARRAY_SIZE(rtc_resources),\n" + "> -\t\t.resources =3D &rtc_resources[0],\n" + "> +\t\t.resources =3D rtc_resources,\n" "> \t},\n" "> };\n" - "> \n" - "> -static const struct rk808_reg_data pre_init_reg[] = {\n" - "> +static const struct mfd_cell rk818s[] = {\n" - "> +\t{ .name = \"rk808-clkout\", },\n" - "> +\t{ .name = \"rk808-regulator\", },\n" + "> =20\n" + "> -static const struct rk808_reg_data pre_init_reg[] =3D {\n" + "> +static const struct mfd_cell rk818s[] =3D {\n" + "> +\t{ .name =3D \"rk808-clkout\", },\n" + "> +\t{ .name =3D \"rk808-regulator\", },\n" "> +\t{\n" - "> +\t\t.name = \"rk808-rtc\",\n" - "> +\t\t.num_resources = ARRAY_SIZE(rtc_resources),\n" - "> +\t\t.resources = rtc_resources,\n" + "> +\t\t.name =3D \"rk808-rtc\",\n" + "> +\t\t.num_resources =3D ARRAY_SIZE(rtc_resources),\n" + "> +\t\t.resources =3D rtc_resources,\n" "> +\t},\n" "> +};\n" "> +\n" - "> +static const struct rk808_reg_data rk808_pre_init_reg[] = {\n" + "> +static const struct rk808_reg_data rk808_pre_init_reg[] =3D {\n" "> \t{ RK808_BUCK3_CONFIG_REG, BUCK_ILMIN_MASK, BUCK_ILMIN_150MA },\n" "> \t{ RK808_BUCK4_CONFIG_REG, BUCK_ILMIN_MASK, BUCK_ILMIN_200MA },\n" "> \t{ RK808_BOOST_CONFIG_REG, BOOST_ILMIN_MASK, BOOST_ILMIN_100MA },\n" - "> @@ -94,6 +117,24 @@ static const struct rk808_reg_data pre_init_reg[] = {\n" + "> @@ -94,6 +117,24 @@ static const struct rk808_reg_data pre_init_reg[] =3D=\n" + " {\n" "> \t\t\t\t\t\t VB_LO_SEL_3500MV },\n" "> };\n" - "> \n" - "> +static const struct rk808_reg_data rk818_pre_init_reg[] = {\n" + "> =20\n" + "> +static const struct rk808_reg_data rk818_pre_init_reg[] =3D {\n" "> +\t/* improve efficiency */\n" "> +\t{ RK818_BUCK2_CONFIG_REG, BUCK2_RATE_MASK, BUCK_ILMIN_250MA },\n" "> +\t{ RK818_BUCK4_CONFIG_REG, BUCK_ILMIN_MASK, BUCK_ILMIN_250MA },\n" @@ -159,100 +164,100 @@ "> +\t\t\t\t\t\t VB_LO_SEL_3500MV },\n" "> +};\n" "> +\n" - "> static const struct regmap_irq rk808_irqs[] = {\n" + "> static const struct regmap_irq rk808_irqs[] =3D {\n" "> \t/* INT_STS */\n" - "> \t[RK808_IRQ_VOUT_LO] = {\n" - "> @@ -136,6 +177,76 @@ static const struct regmap_irq rk808_irqs[] = {\n" + "> \t[RK808_IRQ_VOUT_LO] =3D {\n" + "> @@ -136,6 +177,76 @@ static const struct regmap_irq rk808_irqs[] =3D {\n" "> \t},\n" "> };\n" - "> \n" - "> +static const struct regmap_irq rk818_irqs[] = {\n" + "> =20\n" + "> +static const struct regmap_irq rk818_irqs[] =3D {\n" "> +\t/* INT_STS */\n" - "> +\t[RK818_IRQ_VOUT_LO] = {\n" - "> +\t\t.mask = RK818_IRQ_VOUT_LO_MSK,\n" - "> +\t\t.reg_offset = 0,\n" + "> +\t[RK818_IRQ_VOUT_LO] =3D {\n" + "> +\t\t.mask =3D RK818_IRQ_VOUT_LO_MSK,\n" + "> +\t\t.reg_offset =3D 0,\n" "> +\t},\n" - "> +\t[RK818_IRQ_VB_LO] = {\n" - "> +\t\t.mask = RK818_IRQ_VB_LO_MSK,\n" - "> +\t\t.reg_offset = 0,\n" + "> +\t[RK818_IRQ_VB_LO] =3D {\n" + "> +\t\t.mask =3D RK818_IRQ_VB_LO_MSK,\n" + "> +\t\t.reg_offset =3D 0,\n" "> +\t},\n" - "> +\t[RK818_IRQ_PWRON] = {\n" - "> +\t\t.mask = RK818_IRQ_PWRON_MSK,\n" - "> +\t\t.reg_offset = 0,\n" + "> +\t[RK818_IRQ_PWRON] =3D {\n" + "> +\t\t.mask =3D RK818_IRQ_PWRON_MSK,\n" + "> +\t\t.reg_offset =3D 0,\n" "> +\t},\n" - "> +\t[RK818_IRQ_PWRON_LP] = {\n" - "> +\t\t.mask = RK818_IRQ_PWRON_LP_MSK,\n" - "> +\t\t.reg_offset = 0,\n" + "> +\t[RK818_IRQ_PWRON_LP] =3D {\n" + "> +\t\t.mask =3D RK818_IRQ_PWRON_LP_MSK,\n" + "> +\t\t.reg_offset =3D 0,\n" "> +\t},\n" - "> +\t[RK818_IRQ_HOTDIE] = {\n" - "> +\t\t.mask = RK818_IRQ_HOTDIE_MSK,\n" - "> +\t\t.reg_offset = 0,\n" + "> +\t[RK818_IRQ_HOTDIE] =3D {\n" + "> +\t\t.mask =3D RK818_IRQ_HOTDIE_MSK,\n" + "> +\t\t.reg_offset =3D 0,\n" "> +\t},\n" - "> +\t[RK818_IRQ_RTC_ALARM] = {\n" - "> +\t\t.mask = RK818_IRQ_RTC_ALARM_MSK,\n" - "> +\t\t.reg_offset = 0,\n" + "> +\t[RK818_IRQ_RTC_ALARM] =3D {\n" + "> +\t\t.mask =3D RK818_IRQ_RTC_ALARM_MSK,\n" + "> +\t\t.reg_offset =3D 0,\n" "> +\t},\n" - "> +\t[RK818_IRQ_RTC_PERIOD] = {\n" - "> +\t\t.mask = RK818_IRQ_RTC_PERIOD_MSK,\n" - "> +\t\t.reg_offset = 0,\n" + "> +\t[RK818_IRQ_RTC_PERIOD] =3D {\n" + "> +\t\t.mask =3D RK818_IRQ_RTC_PERIOD_MSK,\n" + "> +\t\t.reg_offset =3D 0,\n" "> +\t},\n" - "> +\t[RK818_IRQ_USB_OV] = {\n" - "> +\t\t.mask = RK818_IRQ_USB_OV_MSK,\n" - "> +\t\t.reg_offset = 0,\n" + "> +\t[RK818_IRQ_USB_OV] =3D {\n" + "> +\t\t.mask =3D RK818_IRQ_USB_OV_MSK,\n" + "> +\t\t.reg_offset =3D 0,\n" "> +\t},\n" "> +\n" "> +\t/* INT_STS2 */\n" - "> +\t[RK818_IRQ_PLUG_IN] = {\n" - "> +\t\t.mask = RK818_IRQ_PLUG_IN_MSK,\n" - "> +\t\t.reg_offset = 1,\n" + "> +\t[RK818_IRQ_PLUG_IN] =3D {\n" + "> +\t\t.mask =3D RK818_IRQ_PLUG_IN_MSK,\n" + "> +\t\t.reg_offset =3D 1,\n" "> +\t},\n" - "> +\t[RK818_IRQ_PLUG_OUT] = {\n" - "> +\t\t.mask = RK818_IRQ_PLUG_OUT_MSK,\n" - "> +\t\t.reg_offset = 1,\n" + "> +\t[RK818_IRQ_PLUG_OUT] =3D {\n" + "> +\t\t.mask =3D RK818_IRQ_PLUG_OUT_MSK,\n" + "> +\t\t.reg_offset =3D 1,\n" "> +\t},\n" - "> +\t[RK818_IRQ_CHG_OK] = {\n" - "> +\t\t.mask = RK818_IRQ_CHG_OK_MSK,\n" - "> +\t\t.reg_offset = 1,\n" + "> +\t[RK818_IRQ_CHG_OK] =3D {\n" + "> +\t\t.mask =3D RK818_IRQ_CHG_OK_MSK,\n" + "> +\t\t.reg_offset =3D 1,\n" "> +\t},\n" - "> +\t[RK818_IRQ_CHG_TE] = {\n" - "> +\t\t.mask = RK818_IRQ_CHG_TE_MSK,\n" - "> +\t\t.reg_offset = 1,\n" + "> +\t[RK818_IRQ_CHG_TE] =3D {\n" + "> +\t\t.mask =3D RK818_IRQ_CHG_TE_MSK,\n" + "> +\t\t.reg_offset =3D 1,\n" "> +\t},\n" - "> +\t[RK818_IRQ_CHG_TS1] = {\n" - "> +\t\t.mask = RK818_IRQ_CHG_TS1_MSK,\n" - "> +\t\t.reg_offset = 1,\n" + "> +\t[RK818_IRQ_CHG_TS1] =3D {\n" + "> +\t\t.mask =3D RK818_IRQ_CHG_TS1_MSK,\n" + "> +\t\t.reg_offset =3D 1,\n" "> +\t},\n" - "> +\t[RK818_IRQ_TS2] = {\n" - "> +\t\t.mask = RK818_IRQ_TS2_MSK,\n" - "> +\t\t.reg_offset = 1,\n" + "> +\t[RK818_IRQ_TS2] =3D {\n" + "> +\t\t.mask =3D RK818_IRQ_TS2_MSK,\n" + "> +\t\t.reg_offset =3D 1,\n" "> +\t},\n" - "> +\t[RK818_IRQ_CHG_CVTLIM] = {\n" - "> +\t\t.mask = RK818_IRQ_CHG_CVTLIM_MSK,\n" - "> +\t\t.reg_offset = 1,\n" + "> +\t[RK818_IRQ_CHG_CVTLIM] =3D {\n" + "> +\t\t.mask =3D RK818_IRQ_CHG_CVTLIM_MSK,\n" + "> +\t\t.reg_offset =3D 1,\n" "> +\t},\n" - "> +\t[RK818_IRQ_DISCHG_ILIM] = {\n" - "> +\t\t.mask = RK818_IRQ_DISCHG_ILIM_MSK,\n" - "> +\t\t.reg_offset = 1,\n" + "> +\t[RK818_IRQ_DISCHG_ILIM] =3D {\n" + "> +\t\t.mask =3D RK818_IRQ_DISCHG_ILIM_MSK,\n" + "> +\t\t.reg_offset =3D 1,\n" "> +\t},\n" "> +};\n" "> +\n" - "> static struct regmap_irq_chip rk808_irq_chip = {\n" - "> \t.name = \"rk808\",\n" - "> \t.irqs = rk808_irqs,\n" - "> @@ -148,6 +259,18 @@ static struct regmap_irq_chip rk808_irq_chip = {\n" - "> \t.init_ack_masked = true,\n" + "> static struct regmap_irq_chip rk808_irq_chip =3D {\n" + "> \t.name =3D \"rk808\",\n" + "> \t.irqs =3D rk808_irqs,\n" + "> @@ -148,6 +259,18 @@ static struct regmap_irq_chip rk808_irq_chip =3D {\n" + "> \t.init_ack_masked =3D true,\n" "> };\n" - "> \n" - "> +static struct regmap_irq_chip rk818_irq_chip = {\n" - "> +\t.name = \"rk818\",\n" - "> +\t.irqs = rk818_irqs,\n" - "> +\t.num_irqs = ARRAY_SIZE(rk818_irqs),\n" - "> +\t.num_regs = 2,\n" - "> +\t.irq_reg_stride = 2,\n" - "> +\t.status_base = RK818_INT_STS_REG1,\n" - "> +\t.mask_base = RK818_INT_STS_MSK_REG1,\n" - "> +\t.ack_base = RK818_INT_STS_REG1,\n" - "> +\t.init_ack_masked = true,\n" + "> =20\n" + "> +static struct regmap_irq_chip rk818_irq_chip =3D {\n" + "> +\t.name =3D \"rk818\",\n" + "> +\t.irqs =3D rk818_irqs,\n" + "> +\t.num_irqs =3D ARRAY_SIZE(rk818_irqs),\n" + "> +\t.num_regs =3D 2,\n" + "> +\t.irq_reg_stride =3D 2,\n" + "> +\t.status_base =3D RK818_INT_STS_REG1,\n" + "> +\t.mask_base =3D RK818_INT_STS_MSK_REG1,\n" + "> +\t.ack_base =3D RK818_INT_STS_REG1,\n" + "> +\t.init_ack_masked =3D true,\n" "> +};\n" "> +\n" "> static struct i2c_client *rk808_i2c_client;\n" @@ -261,10 +266,10 @@ "> @@ -167,55 +290,99 @@ static void rk808_device_shutdown(void)\n" "> \t\tdev_err(&rk808_i2c_client->dev, \"power off error!\\n\");\n" "> }\n" - "> \n" - "> +static const struct of_device_id rk808_of_match[] = {\n" - "> +\t{ .compatible = \"rockchip,rk808\", .data = (void *) RK808_ID },\n" - "> +\t{ .compatible = \"rockchip,rk818\", .data = (void *) RK818_ID },\n" + "> =20\n" + "> +static const struct of_device_id rk808_of_match[] =3D {\n" + "> +\t{ .compatible =3D \"rockchip,rk808\", .data =3D (void *) RK808_ID },\n" + "> +\t{ .compatible =3D \"rockchip,rk818\", .data =3D (void *) RK818_ID },\n" "> +\t{ },\n" "> +};\n" "> +MODULE_DEVICE_TABLE(of, rk808_of_match);\n" @@ -272,50 +277,50 @@ "> static int rk808_probe(struct i2c_client *client,\n" "> \t\t const struct i2c_device_id *id)\n" "> {\n" - "> \tstruct device_node *np = client->dev.of_node;\n" + "> \tstruct device_node *np =3D client->dev.of_node;\n" "> \tstruct rk808 *rk808;\n" "> +\tconst struct of_device_id *match;\n" "> +\tconst struct rk808_reg_data *pre_init_reg;\n" "> +\tconst struct mfd_cell *cells;\n" "> +\tint nr_pre_init_regs;\n" "> +\tint nr_cells;\n" - "> \tint pm_off = 0;\n" + "> \tint pm_off =3D 0;\n" "> \tint ret;\n" "> \tint i;\n" - "> \n" + "> =20\n" "> -\tif (!client->irq) {\n" "> -\t\tdev_err(&client->dev, \"No interrupt support, no core IRQ\\n\");\n" "> -\t\treturn -EINVAL;\n" "> -\t}\n" "> -\n" - "> \trk808 = devm_kzalloc(&client->dev, sizeof(*rk808), GFP_KERNEL);\n" + "> \trk808 =3D devm_kzalloc(&client->dev, sizeof(*rk808), GFP_KERNEL);\n" "> \tif (!rk808)\n" "> \t\treturn -ENOMEM;\n" - "> \n" - "> -\trk808->regmap = devm_regmap_init_i2c(client, &rk808_regmap_config);\n" - "> +\tmatch = of_match_device(rk808_of_match, &client->dev);\n" + "> =20\n" + "> -\trk808->regmap =3D devm_regmap_init_i2c(client, &rk808_regmap_config);\n" + "> +\tmatch =3D of_match_device(rk808_of_match, &client->dev);\n" "> +\tif (!match) {\n" "> +\t\tdev_err(&client->dev, \"Unable to match OF ID\\n\");\n" "> +\t\treturn -ENODEV;\n" "> +\t}\n" - "> +\trk808->variant = (long)match->data;\n" + "> +\trk808->variant =3D (long)match->data;\n" "> +\n" "> +\tswitch (rk808->variant) {\n" "> +\tcase RK808_ID:\n" - "> +\t\trk808->regmap_cfg = &rk808_regmap_config;\n" - "> +\t\trk808->regmap_irq_chip = &rk808_irq_chip;\n" - "> +\t\tpre_init_reg = rk808_pre_init_reg;\n" - "> +\t\tnr_pre_init_regs = ARRAY_SIZE(rk808_pre_init_reg);\n" - "> +\t\tcells = rk808s;\n" - "> +\t\tnr_cells = ARRAY_SIZE(rk808s);\n" + "> +\t\trk808->regmap_cfg =3D &rk808_regmap_config;\n" + "> +\t\trk808->regmap_irq_chip =3D &rk808_irq_chip;\n" + "> +\t\tpre_init_reg =3D rk808_pre_init_reg;\n" + "> +\t\tnr_pre_init_regs =3D ARRAY_SIZE(rk808_pre_init_reg);\n" + "> +\t\tcells =3D rk808s;\n" + "> +\t\tnr_cells =3D ARRAY_SIZE(rk808s);\n" "> +\t\tbreak;\n" "> +\tcase RK818_ID:\n" - "> +\t\trk808->regmap_cfg = &rk818_regmap_config;\n" - "> +\t\trk808->regmap_irq_chip = &rk818_irq_chip;\n" - "> +\t\tpre_init_reg = rk818_pre_init_reg;\n" - "> +\t\tnr_pre_init_regs = ARRAY_SIZE(rk818_pre_init_reg);\n" - "> +\t\tcells = rk818s;\n" - "> +\t\tnr_cells = ARRAY_SIZE(rk818s);\n" + "> +\t\trk808->regmap_cfg =3D &rk818_regmap_config;\n" + "> +\t\trk808->regmap_irq_chip =3D &rk818_irq_chip;\n" + "> +\t\tpre_init_reg =3D rk818_pre_init_reg;\n" + "> +\t\tnr_pre_init_regs =3D ARRAY_SIZE(rk818_pre_init_reg);\n" + "> +\t\tcells =3D rk818s;\n" + "> +\t\tnr_cells =3D ARRAY_SIZE(rk818s);\n" "> +\t\tbreak;\n" "> +\tdefault:\n" "> +\t\tdev_err(&client->dev, \"Unsupported RK8XX ID %lu\\n\",\n" @@ -323,17 +328,17 @@ "> +\t\treturn -EINVAL;\n" "> +\t}\n" "> +\n" - "> +\trk808->i2c = client;\n" + "> +\trk808->i2c =3D client;\n" "> +\ti2c_set_clientdata(client, rk808);\n" "> +\n" - "> +\trk808->regmap = devm_regmap_init_i2c(client, rk808->regmap_cfg);\n" + "> +\trk808->regmap =3D devm_regmap_init_i2c(client, rk808->regmap_cfg);\n" "> \tif (IS_ERR(rk808->regmap)) {\n" "> \t\tdev_err(&client->dev, \"regmap initialization failed\\n\");\n" "> \t\treturn PTR_ERR(rk808->regmap);\n" "> \t}\n" - "> \n" - "> -\tfor (i = 0; i < ARRAY_SIZE(pre_init_reg); i++) {\n" - "> -\t\tret = regmap_update_bits(rk808->regmap, pre_init_reg[i].addr,\n" + "> =20\n" + "> -\tfor (i =3D 0; i < ARRAY_SIZE(pre_init_reg); i++) {\n" + "> -\t\tret =3D regmap_update_bits(rk808->regmap, pre_init_reg[i].addr,\n" "> -\t\t\t\t\t pre_init_reg[i].mask,\n" "> -\t\t\t\t\t pre_init_reg[i].value);\n" "> -\t\tif (ret) {\n" @@ -345,8 +350,8 @@ "> +\t\tdev_err(&client->dev, \"No interrupt support, no core IRQ\\n\");\n" "> +\t\treturn -EINVAL;\n" "> \t}\n" - "> \n" - "> \tret = regmap_add_irq_chip(rk808->regmap, client->irq,\n" + "> =20\n" + "> \tret =3D regmap_add_irq_chip(rk808->regmap, client->irq,\n" "> \t\t\t\t IRQF_ONESHOT, -1,\n" "> -\t\t\t\t &rk808_irq_chip, &rk808->irq_data);\n" "> +\t\t\t\t rk808->regmap_irq_chip, &rk808->irq_data);\n" @@ -354,11 +359,11 @@ "> \t\tdev_err(&client->dev, \"Failed to add irq_chip %d\\n\", ret);\n" "> \t\treturn ret;\n" "> \t}\n" - "> \n" - "> -\trk808->i2c = client;\n" + "> =20\n" + "> -\trk808->i2c =3D client;\n" "> -\ti2c_set_clientdata(client, rk808);\n" - "> +\tfor (i = 0; i < nr_pre_init_regs; i++) {\n" - "> +\t\tret = regmap_update_bits(rk808->regmap,\n" + "> +\tfor (i =3D 0; i < nr_pre_init_regs; i++) {\n" + "> +\t\tret =3D regmap_update_bits(rk808->regmap,\n" "> +\t\t\t\t\tpre_init_reg[i].addr,\n" "> +\t\t\t\t\tpre_init_reg[i].mask,\n" "> +\t\t\t\t\tpre_init_reg[i].value);\n" @@ -369,11 +374,11 @@ "> +\t\t\treturn ret;\n" "> +\t\t}\n" "> +\t}\n" - "> \n" - "> -\tret = devm_mfd_add_devices(&client->dev, -1,\n" + "> =20\n" + "> -\tret =3D devm_mfd_add_devices(&client->dev, -1,\n" "> -\t\t\t\t rk808s, ARRAY_SIZE(rk808s), NULL, 0,\n" "> -\t\t\t\t regmap_irq_get_domain(rk808->irq_data));\n" - "> +\tret = devm_mfd_add_devices(&client->dev, PLATFORM_DEVID_NONE,\n" + "> +\tret =3D devm_mfd_add_devices(&client->dev, PLATFORM_DEVID_NONE,\n" "> +\t\t\t cells, nr_cells, NULL, 0,\n" "> +\t\t\t regmap_irq_get_domain(rk808->irq_data));\n" "> \tif (ret) {\n" @@ -382,14 +387,14 @@ "> @@ -245,14 +412,9 @@ static int rk808_remove(struct i2c_client *client)\n" "> \treturn 0;\n" "> }\n" - "> \n" - "> -static const struct of_device_id rk808_of_match[] = {\n" - "> -\t{ .compatible = \"rockchip,rk808\" },\n" + "> =20\n" + "> -static const struct of_device_id rk808_of_match[] =3D {\n" + "> -\t{ .compatible =3D \"rockchip,rk808\" },\n" "> -\t{ },\n" "> -};\n" "> -MODULE_DEVICE_TABLE(of, rk808_of_match);\n" "> -\n" - "> static const struct i2c_device_id rk808_ids[] = {\n" + "> static const struct i2c_device_id rk808_ids[] =3D {\n" "> \t{ \"rk808\" },\n" "> +\t{ \"rk818\" },\n" "> \t{ },\n" @@ -420,33 +425,34 @@ "> + *\n" "> + * Author: Wadim Egorov <w.egorov@phytec.de>\n" "> + *\n" - "> * This program is free software; you can redistribute it and/or modify it\n" + "> * This program is free software; you can redistribute it and/or modify =\n" + "it\n" "> * under the terms and conditions of the GNU General Public License,\n" "> * version 2, as published by the Free Software Foundation.\n" "> @@ -16,8 +20,8 @@\n" "> * more details.\n" "> */\n" - "> \n" + "> =20\n" "> -#ifndef __LINUX_REGULATOR_rk808_H\n" "> -#define __LINUX_REGULATOR_rk808_H\n" "> +#ifndef __LINUX_REGULATOR_RK808_H\n" "> +#define __LINUX_REGULATOR_RK808_H\n" - "> \n" + "> =20\n" "> #include <linux/regulator/machine.h>\n" "> #include <linux/regmap.h>\n" "> @@ -28,7 +32,7 @@\n" - "> \n" + "> =20\n" "> #define RK808_DCDC1\t0 /* (0+RK808_START) */\n" "> #define RK808_LDO1\t4 /* (4+RK808_START) */\n" "> -#define RK808_NUM_REGULATORS 14\n" "> +#define RK808_NUM_REGULATORS\t14\n" - "> \n" + "> =20\n" "> enum rk808_reg {\n" "> \tRK808_ID_DCDC1,\n" "> @@ -115,7 +119,92 @@ enum rk808_reg {\n" "> #define RK808_INT_STS_MSK_REG2\t0x4f\n" "> #define RK808_IO_POL_REG\t0x50\n" - "> \n" + "> =20\n" "> -/* IRQ Definitions */\n" "> +/* RK818 */\n" "> +#define RK818_DCDC1\t\t\t0\n" @@ -540,7 +546,7 @@ "> @@ -137,6 +226,43 @@ enum rk808_reg {\n" "> #define RK808_IRQ_PLUG_IN_INT_MSK\tBIT(0)\n" "> #define RK808_IRQ_PLUG_OUT_INT_MSK\tBIT(1)\n" - "> \n" + "> =20\n" "> +/* RK818 IRQ Definitions */\n" "> +#define RK818_IRQ_VOUT_LO\t0\n" "> +#define RK818_IRQ_VB_LO\t\t1\n" @@ -584,7 +590,7 @@ "> @@ -191,9 +317,17 @@ enum {\n" "> \tBOOST_ILMIN_250MA,\n" "> };\n" - "> \n" + "> =20\n" "> +enum {\n" "> +\tRK808_ID,\n" "> +\tRK818_ID,\n" @@ -604,10 +610,22 @@ "> -#endif /* __LINUX_REGULATOR_rk808_H */\n" "> +#endif /* __LINUX_REGULATOR_RK808_H */\n" "\n" - "-- \n" + "--=20\n" "Lee Jones\n" "Linaro STMicroelectronics Landing Team Lead\n" - "Linaro.org \342\224\202 Open source software for ARM SoCs\n" - Follow Linaro: Facebook | Twitter | Blog + "Linaro.org =E2=94=82 Open source software for ARM SoCs\n" + "Follow Linaro: Facebook | Twitter | Blog\n" + "\n" + "--=20\n" + "You received this message because you are subscribed to \"rtc-linux\".\n" + "Membership options at http://groups.google.com/group/rtc-linux .\n" + "Please read http://groups.google.com/group/rtc-linux/web/checklist\n" + "before submitting a driver.\n" + "---=20\n" + "You received this message because you are subscribed to the Google Groups \"=\n" + "rtc-linux\" group.\n" + "To unsubscribe from this group and stop receiving emails from it, send an e=\n" + "mail to rtc-linux+unsubscribe@googlegroups.com.\n" + For more options, visit https://groups.google.com/d/optout. -193693ec4d8a54a9610ade1533db967bf4e2b46f6d54b689e0fc523901b59d7d +20f4771cf26122169e6eaab3a57838d4c5e05d637a1ba63873744c5c26488bea
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.