[2/3] mfd: wm5110: Add register patch for rev E and above
diff mbox

Message ID 1435838281-15873-2-git-send-email-ckeepax@opensource.wolfsonmicro.com
State New
Headers show

Commit Message

Charles Keepax July 2, 2015, 11:58 a.m. UTC
Add a register patch for rev E and above that configures the location of
some write sequences to assist with the headphone enables.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
---
 drivers/mfd/wm5110-tables.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

Comments

Lee Jones July 7, 2015, 7:11 a.m. UTC | #1
On Thu, 02 Jul 2015, Charles Keepax wrote:

> Add a register patch for rev E and above that configures the location of
> some write sequences to assist with the headphone enables.

I think a comment to that effect would not go amiss.

You know the rules, either define magic numbers or comment them.

> Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
> ---
>  drivers/mfd/wm5110-tables.c |   13 ++++++++++++-
>  1 files changed, 12 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/mfd/wm5110-tables.c b/drivers/mfd/wm5110-tables.c
> index 62a4aa1..05bef23 100644
> --- a/drivers/mfd/wm5110-tables.c
> +++ b/drivers/mfd/wm5110-tables.c
> @@ -249,6 +249,15 @@ static const struct reg_default wm5110_revd_patch[] = {
>  	{ 0x80, 0x0 },
>  };
>  
> +static const struct reg_default wm5110_reve_patch[] = {
> +	{ 0x80, 0x3 },
> +	{ 0x80, 0x3 },
> +	{ 0x4b, 0x138 },
> +	{ 0x4c, 0x13d },
> +	{ 0x80, 0x0 },
> +	{ 0x80, 0x0 },
> +};
> +
>  /* We use a function so we can use ARRAY_SIZE() */
>  int wm5110_patch(struct arizona *arizona)
>  {
> @@ -266,7 +275,9 @@ int wm5110_patch(struct arizona *arizona)
>  					     wm5110_revd_patch,
>  					     ARRAY_SIZE(wm5110_revd_patch));
>  	default:
> -		return 0;
> +		return regmap_register_patch(arizona->regmap,
> +					     wm5110_reve_patch,
> +					     ARRAY_SIZE(wm5110_reve_patch));
>  	}
>  }
>  EXPORT_SYMBOL_GPL(wm5110_patch);

Patch
diff mbox

diff --git a/drivers/mfd/wm5110-tables.c b/drivers/mfd/wm5110-tables.c
index 62a4aa1..05bef23 100644
--- a/drivers/mfd/wm5110-tables.c
+++ b/drivers/mfd/wm5110-tables.c
@@ -249,6 +249,15 @@  static const struct reg_default wm5110_revd_patch[] = {
 	{ 0x80, 0x0 },
 };
 
+static const struct reg_default wm5110_reve_patch[] = {
+	{ 0x80, 0x3 },
+	{ 0x80, 0x3 },
+	{ 0x4b, 0x138 },
+	{ 0x4c, 0x13d },
+	{ 0x80, 0x0 },
+	{ 0x80, 0x0 },
+};
+
 /* We use a function so we can use ARRAY_SIZE() */
 int wm5110_patch(struct arizona *arizona)
 {
@@ -266,7 +275,9 @@  int wm5110_patch(struct arizona *arizona)
 					     wm5110_revd_patch,
 					     ARRAY_SIZE(wm5110_revd_patch));
 	default:
-		return 0;
+		return regmap_register_patch(arizona->regmap,
+					     wm5110_reve_patch,
+					     ARRAY_SIZE(wm5110_reve_patch));
 	}
 }
 EXPORT_SYMBOL_GPL(wm5110_patch);