From: Lee Jones <lee.jones@linaro.org>
To: Doug Anderson <dianders@chromium.org>
Cc: Anton Vorontsov <anton@enomsg.org>,
Olof Johansson <olof@lixom.net>,
Sachin Kamat <sachin.kamat@linaro.org>,
ajaykumar.rs@samsung.com, linux-samsung-soc@vger.kernel.org,
Samuel Ortiz <sameo@linux.intel.com>,
Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
David Woodhouse <dwmw2@infradead.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 3/5] mfd: tps65090: Stop caching most registers
Date: Wed, 23 Apr 2014 12:27:58 +0100 [thread overview]
Message-ID: <20140423112758.GK21613@lee--X1> (raw)
In-Reply-To: <1397689950-1568-4-git-send-email-dianders@chromium.org>
Anton,
> Nearly all of the registers in tps65090 combine control bits and
> status bits. Turn off caching of all registers except the select few
> that can be cached.
>
> In order to avoid adding more duplicate #defines, we also move some
> register offset definitions to the mfd driver (and resolve
> inconsistent names).
>
> Signed-off-by: Doug Anderson <dianders@chromium.org>
> ---
> Changes in v3: None
> Changes in v2:
> - Leave cache on for the registers that can be cached.
> - Move register offsets to mfd header file.
>
> drivers/mfd/tps65090.c | 27 ++++++++++++++-------------
> drivers/power/tps65090-charger.c | 11 -----------
This patch still requires your Ack.
> include/linux/mfd/tps65090.h | 14 ++++++++++++++
> 3 files changed, 28 insertions(+), 24 deletions(-)
>
> diff --git a/drivers/mfd/tps65090.c b/drivers/mfd/tps65090.c
> index c3cddb4..1c3e6e2 100644
> --- a/drivers/mfd/tps65090.c
> +++ b/drivers/mfd/tps65090.c
> @@ -32,14 +32,6 @@
> #define NUM_INT_REG 2
> #define TOTAL_NUM_REG 0x18
>
> -/* interrupt status registers */
> -#define TPS65090_INT_STS 0x0
> -#define TPS65090_INT_STS2 0x1
> -
> -/* interrupt mask registers */
> -#define TPS65090_INT_MSK 0x2
> -#define TPS65090_INT_MSK2 0x3
> -
> #define TPS65090_INT1_MASK_VAC_STATUS_CHANGE 1
> #define TPS65090_INT1_MASK_VSYS_STATUS_CHANGE 2
> #define TPS65090_INT1_MASK_BAT_STATUS_CHANGE 3
> @@ -144,17 +136,26 @@ static struct regmap_irq_chip tps65090_irq_chip = {
> .irqs = tps65090_irqs,
> .num_irqs = ARRAY_SIZE(tps65090_irqs),
> .num_regs = NUM_INT_REG,
> - .status_base = TPS65090_INT_STS,
> - .mask_base = TPS65090_INT_MSK,
> + .status_base = TPS65090_REG_INTR_STS,
> + .mask_base = TPS65090_REG_INTR_MASK,
> .mask_invert = true,
> };
>
> static bool is_volatile_reg(struct device *dev, unsigned int reg)
> {
> - if ((reg == TPS65090_INT_STS) || (reg == TPS65090_INT_STS2))
> - return true;
> - else
> + /* Nearly all registers have status bits mixed in, except a few */
> + switch (reg) {
> + case TPS65090_REG_INTR_MASK:
> + case TPS65090_REG_INTR_MASK2:
> + case TPS65090_REG_CG_CTRL0:
> + case TPS65090_REG_CG_CTRL1:
> + case TPS65090_REG_CG_CTRL2:
> + case TPS65090_REG_CG_CTRL3:
> + case TPS65090_REG_CG_CTRL4:
> + case TPS65090_REG_CG_CTRL5:
> return false;
> + }
> + return true;
> }
>
> static const struct regmap_config tps65090_regmap_config = {
> diff --git a/drivers/power/tps65090-charger.c b/drivers/power/tps65090-charger.c
> index cc26c12..31a3ba4 100644
> --- a/drivers/power/tps65090-charger.c
> +++ b/drivers/power/tps65090-charger.c
> @@ -30,17 +30,6 @@
>
> #include <linux/mfd/tps65090.h>
>
> -#define TPS65090_REG_INTR_STS 0x00
> -#define TPS65090_REG_INTR_MASK 0x02
> -#define TPS65090_REG_CG_CTRL0 0x04
> -#define TPS65090_REG_CG_CTRL1 0x05
> -#define TPS65090_REG_CG_CTRL2 0x06
> -#define TPS65090_REG_CG_CTRL3 0x07
> -#define TPS65090_REG_CG_CTRL4 0x08
> -#define TPS65090_REG_CG_CTRL5 0x09
> -#define TPS65090_REG_CG_STATUS1 0x0a
> -#define TPS65090_REG_CG_STATUS2 0x0b
> -
> #define TPS65090_CHARGER_ENABLE BIT(0)
> #define TPS65090_VACG BIT(1)
> #define TPS65090_NOITERM BIT(5)
> diff --git a/include/linux/mfd/tps65090.h b/include/linux/mfd/tps65090.h
> index 3f43069..45f0f9d 100644
> --- a/include/linux/mfd/tps65090.h
> +++ b/include/linux/mfd/tps65090.h
> @@ -64,6 +64,20 @@ enum {
> TPS65090_REGULATOR_MAX,
> };
>
> +/* Register addresses */
> +#define TPS65090_REG_INTR_STS 0x00
> +#define TPS65090_REG_INTR_STS2 0x01
> +#define TPS65090_REG_INTR_MASK 0x02
> +#define TPS65090_REG_INTR_MASK2 0x03
> +#define TPS65090_REG_CG_CTRL0 0x04
> +#define TPS65090_REG_CG_CTRL1 0x05
> +#define TPS65090_REG_CG_CTRL2 0x06
> +#define TPS65090_REG_CG_CTRL3 0x07
> +#define TPS65090_REG_CG_CTRL4 0x08
> +#define TPS65090_REG_CG_CTRL5 0x09
> +#define TPS65090_REG_CG_STATUS1 0x0a
> +#define TPS65090_REG_CG_STATUS2 0x0b
> +
> struct tps65090 {
> struct device *dev;
> struct regmap *rmap;
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
next prev parent reply other threads:[~2014-04-23 11:28 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-16 23:12 [PATCH v3 0/5] Fixes for tps65090 for Samsung ARM Chromebook Doug Anderson
2014-04-16 23:12 ` [PATCH v3 1/5] mfd: tps65090: Don't tell child devices we have an IRQ if we don't Doug Anderson
2014-04-23 11:49 ` Lee Jones
2014-04-16 23:12 ` [PATCH v3 2/5] charger: tps65090: Allow charger module to be used when no irq Doug Anderson
2014-04-16 23:12 ` [PATCH v3 3/5] mfd: tps65090: Stop caching most registers Doug Anderson
2014-04-17 11:00 ` Lee Jones
2014-04-17 15:51 ` Doug Anderson
2014-04-23 11:27 ` Lee Jones [this message]
2014-04-23 11:50 ` Lee Jones
2014-04-16 23:12 ` [PATCH v3 4/5] regulator: tps65090: Allow setting the overcurrent wait time Doug Anderson
2014-04-18 15:06 ` Mark Brown
2014-04-23 11:51 ` Lee Jones
2014-04-23 15:48 ` Doug Anderson
2014-05-01 18:17 ` Olof Johansson
2014-05-01 18:49 ` Mark Brown
2014-05-01 18:52 ` Doug Anderson
2014-05-01 19:05 ` Mark Brown
2014-04-16 23:12 ` [PATCH v3 5/5] regulator: tps65090: Make FETs more reliable by adding retries Doug Anderson
2014-04-18 17:43 ` Mark Brown
2014-04-18 18:05 ` Doug Anderson
2014-04-22 7:47 ` Lee Jones
2014-04-22 11:02 ` Mark Brown
2014-04-22 15:07 ` Lee Jones
2014-04-22 15:28 ` Doug Anderson
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=20140423112758.GK21613@lee--X1 \
--to=lee.jones@linaro.org \
--cc=ajaykumar.rs@samsung.com \
--cc=anton@enomsg.org \
--cc=dbaryshkov@gmail.com \
--cc=dianders@chromium.org \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=olof@lixom.net \
--cc=sachin.kamat@linaro.org \
--cc=sameo@linux.intel.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