alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] mfd: mc13xxx: Don't require lock for simple register I/O
@ 2013-09-18 18:06 Mark Brown
  2013-09-18 18:06 ` [PATCH 2/3] mfd: mc13xxx: Move SPI erratum workaround into SPI I/O function Mark Brown
  2013-09-18 18:06 ` [PATCH 3/3] ASoC: mc13783: Use regmap directly from ASoC Mark Brown
  0 siblings, 2 replies; 18+ messages in thread
From: Mark Brown @ 2013-09-18 18:06 UTC (permalink / raw)
  To: Lee Jones, Samuel Ortiz, Liam Girdwood, Marc Reilly, u.kleine-koenig
  Cc: linux-kernel, alsa-devel, linaro-kernel, Mark Brown

From: Mark Brown <broonie@linaro.org>

Since the conversion to regmap there has been no need for device level
locking for I/O as regmap provides locking so remove the locks.

Signed-off-by: Mark Brown <broonie@linaro.org>
---
 drivers/mfd/mc13xxx-core.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/mfd/mc13xxx-core.c b/drivers/mfd/mc13xxx-core.c
index 2a9b100..dbbf8ee 100644
--- a/drivers/mfd/mc13xxx-core.c
+++ b/drivers/mfd/mc13xxx-core.c
@@ -158,8 +158,6 @@ int mc13xxx_reg_read(struct mc13xxx *mc13xxx, unsigned int offset, u32 *val)
 {
 	int ret;
 
-	BUG_ON(!mutex_is_locked(&mc13xxx->lock));
-
 	if (offset > MC13XXX_NUMREGS)
 		return -EINVAL;
 
@@ -172,8 +170,6 @@ EXPORT_SYMBOL(mc13xxx_reg_read);
 
 int mc13xxx_reg_write(struct mc13xxx *mc13xxx, unsigned int offset, u32 val)
 {
-	BUG_ON(!mutex_is_locked(&mc13xxx->lock));
-
 	dev_vdbg(mc13xxx->dev, "[0x%02x] <- 0x%06x\n", offset, val);
 
 	if (offset > MC13XXX_NUMREGS || val > 0xffffff)
@@ -186,7 +182,6 @@ EXPORT_SYMBOL(mc13xxx_reg_write);
 int mc13xxx_reg_rmw(struct mc13xxx *mc13xxx, unsigned int offset,
 		u32 mask, u32 val)
 {
-	BUG_ON(!mutex_is_locked(&mc13xxx->lock));
 	BUG_ON(val & ~mask);
 	dev_vdbg(mc13xxx->dev, "[0x%02x] <- 0x%06x (mask: 0x%06x)\n",
 			offset, val, mask);
-- 
1.8.4.rc3

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 2/3] mfd: mc13xxx: Move SPI erratum workaround into SPI I/O function
  2013-09-18 18:06 [PATCH 1/3] mfd: mc13xxx: Don't require lock for simple register I/O Mark Brown
@ 2013-09-18 18:06 ` Mark Brown
  2013-09-19  9:13   ` Lee Jones
  2013-09-18 18:06 ` [PATCH 3/3] ASoC: mc13783: Use regmap directly from ASoC Mark Brown
  1 sibling, 1 reply; 18+ messages in thread
From: Mark Brown @ 2013-09-18 18:06 UTC (permalink / raw)
  To: Lee Jones, Samuel Ortiz, Liam Girdwood, Marc Reilly, u.kleine-koenig
  Cc: linux-kernel, alsa-devel, linaro-kernel, Mark Brown

From: Mark Brown <broonie@linaro.org>

Move the workaround for double sending AUDIO_CODEC and AUDIO_DAC writes
into the SPI core, aiding refactoring to eliminate the ASoC custom I/O
functions and avoiding the extra writes for I2C.

Signed-off-by: Mark Brown <broonie@linaro.org>
---
 drivers/mfd/mc13xxx-spi.c   | 5 +++++
 include/linux/mfd/mc13xxx.h | 7 +++++++
 sound/soc/codecs/mc13783.c  | 4 ----
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/mc13xxx-spi.c b/drivers/mfd/mc13xxx-spi.c
index 77189da..363c359 100644
--- a/drivers/mfd/mc13xxx-spi.c
+++ b/drivers/mfd/mc13xxx-spi.c
@@ -94,10 +94,15 @@ static int mc13xxx_spi_write(void *context, const void *data, size_t count)
 {
 	struct device *dev = context;
 	struct spi_device *spi = to_spi_device(dev);
+	char *reg = data;
 
 	if (count != 4)
 		return -ENOTSUPP;
 
+	/* include errata fix for spi audio problems */
+	if (*reg == MC13783_AUDIO_CODEC || *reg == MC13783_AUDIO_DAC)
+		spi_write(spi, data, count);
+
 	return spi_write(spi, data, count);
 }
 
diff --git a/include/linux/mfd/mc13xxx.h b/include/linux/mfd/mc13xxx.h
index 41ed592..67c17b5 100644
--- a/include/linux/mfd/mc13xxx.h
+++ b/include/linux/mfd/mc13xxx.h
@@ -41,6 +41,13 @@ int mc13xxx_adc_do_conversion(struct mc13xxx *mc13xxx,
 		unsigned int mode, unsigned int channel,
 		u8 ato, bool atox, unsigned int *sample);
 
+#define MC13783_AUDIO_RX0	36
+#define MC13783_AUDIO_RX1	37
+#define MC13783_AUDIO_TX	38
+#define MC13783_SSI_NETWORK	39
+#define MC13783_AUDIO_CODEC	40
+#define MC13783_AUDIO_DAC	41
+
 #define MC13XXX_IRQ_ADCDONE	0
 #define MC13XXX_IRQ_ADCBISDONE	1
 #define MC13XXX_IRQ_TS		2
diff --git a/sound/soc/codecs/mc13783.c b/sound/soc/codecs/mc13783.c
index ea141e1..4d3c8fd 100644
--- a/sound/soc/codecs/mc13783.c
+++ b/sound/soc/codecs/mc13783.c
@@ -125,10 +125,6 @@ static int mc13783_write(struct snd_soc_codec *codec,
 
 	ret = mc13xxx_reg_write(priv->mc13xxx, reg, value);
 
-	/* include errata fix for spi audio problems */
-	if (reg == MC13783_AUDIO_CODEC || reg == MC13783_AUDIO_DAC)
-		ret = mc13xxx_reg_write(priv->mc13xxx, reg, value);
-
 	mc13xxx_unlock(priv->mc13xxx);
 
 	return ret;
-- 
1.8.4.rc3

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 3/3] ASoC: mc13783: Use regmap directly from ASoC
  2013-09-18 18:06 [PATCH 1/3] mfd: mc13xxx: Don't require lock for simple register I/O Mark Brown
  2013-09-18 18:06 ` [PATCH 2/3] mfd: mc13xxx: Move SPI erratum workaround into SPI I/O function Mark Brown
@ 2013-09-18 18:06 ` Mark Brown
  1 sibling, 0 replies; 18+ messages in thread
From: Mark Brown @ 2013-09-18 18:06 UTC (permalink / raw)
  To: Lee Jones, Samuel Ortiz, Liam Girdwood, Marc Reilly, u.kleine-koenig
  Cc: alsa-devel, linaro-kernel, linux-kernel, Mark Brown

From: Mark Brown <broonie@linaro.org>

As part of a push to remove the register I/O functionality from ASoC (since
it is now duplicated in the regmap API) convert the mc13783 driver to use
regmap directly.

Signed-off-by: Mark Brown <broonie@linaro.org>
---
 sound/soc/codecs/mc13783.c | 55 ++++++++--------------------------------------
 1 file changed, 9 insertions(+), 46 deletions(-)

diff --git a/sound/soc/codecs/mc13783.c b/sound/soc/codecs/mc13783.c
index 4d3c8fd..eedbf05 100644
--- a/sound/soc/codecs/mc13783.c
+++ b/sound/soc/codecs/mc13783.c
@@ -30,16 +30,10 @@
 #include <sound/soc.h>
 #include <sound/initval.h>
 #include <sound/soc-dapm.h>
+#include <linux/regmap.h>
 
 #include "mc13783.h"
 
-#define MC13783_AUDIO_RX0	36
-#define MC13783_AUDIO_RX1	37
-#define MC13783_AUDIO_TX	38
-#define MC13783_SSI_NETWORK	39
-#define MC13783_AUDIO_CODEC	40
-#define MC13783_AUDIO_DAC	41
-
 #define AUDIO_RX0_ALSPEN		(1 << 5)
 #define AUDIO_RX0_ALSPSEL		(1 << 7)
 #define AUDIO_RX0_ADDCDC		(1 << 21)
@@ -95,41 +89,12 @@
 
 struct mc13783_priv {
 	struct mc13xxx *mc13xxx;
+	struct regmap *regmap;
 
 	enum mc13783_ssi_port adc_ssi_port;
 	enum mc13783_ssi_port dac_ssi_port;
 };
 
-static unsigned int mc13783_read(struct snd_soc_codec *codec,
-	unsigned int reg)
-{
-	struct mc13783_priv *priv = snd_soc_codec_get_drvdata(codec);
-	unsigned int value = 0;
-
-	mc13xxx_lock(priv->mc13xxx);
-
-	mc13xxx_reg_read(priv->mc13xxx, reg, &value);
-
-	mc13xxx_unlock(priv->mc13xxx);
-
-	return value;
-}
-
-static int mc13783_write(struct snd_soc_codec *codec,
-	unsigned int reg, unsigned int value)
-{
-	struct mc13783_priv *priv = snd_soc_codec_get_drvdata(codec);
-	int ret;
-
-	mc13xxx_lock(priv->mc13xxx);
-
-	ret = mc13xxx_reg_write(priv->mc13xxx, reg, value);
-
-	mc13xxx_unlock(priv->mc13xxx);
-
-	return ret;
-}
-
 /* Mapping between sample rates and register value */
 static unsigned int mc13783_rates[] = {
 	8000, 11025, 12000, 16000,
@@ -583,8 +548,14 @@ static struct snd_kcontrol_new mc13783_control_list[] = {
 static int mc13783_probe(struct snd_soc_codec *codec)
 {
 	struct mc13783_priv *priv = snd_soc_codec_get_drvdata(codec);
+	int ret;
 
-	mc13xxx_lock(priv->mc13xxx);
+	codec->control_data = dev_get_regmap(codec->dev->parent, NULL);
+	ret = snd_soc_codec_set_cache_io(codec, 8, 24, SND_SOC_REGMAP);
+	if (ret != 0) {
+		dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret);
+		return ret;
+	}
 
 	/* these are the reset values */
 	mc13xxx_reg_write(priv->mc13xxx, MC13783_AUDIO_RX0, 0x25893);
@@ -608,8 +579,6 @@ static int mc13783_probe(struct snd_soc_codec *codec)
 		mc13xxx_reg_rmw(priv->mc13xxx, MC13783_AUDIO_DAC,
 				0, AUDIO_SSI_SEL);
 
-	mc13xxx_unlock(priv->mc13xxx);
-
 	return 0;
 }
 
@@ -617,13 +586,9 @@ static int mc13783_remove(struct snd_soc_codec *codec)
 {
 	struct mc13783_priv *priv = snd_soc_codec_get_drvdata(codec);
 
-	mc13xxx_lock(priv->mc13xxx);
-
 	/* Make sure VAUDIOON is off */
 	mc13xxx_reg_rmw(priv->mc13xxx, MC13783_AUDIO_RX0, 0x3, 0);
 
-	mc13xxx_unlock(priv->mc13xxx);
-
 	return 0;
 }
 
@@ -713,8 +678,6 @@ static struct snd_soc_dai_driver mc13783_dai_sync[] = {
 static struct snd_soc_codec_driver soc_codec_dev_mc13783 = {
 	.probe		= mc13783_probe,
 	.remove		= mc13783_remove,
-	.read		= mc13783_read,
-	.write		= mc13783_write,
 	.controls	= mc13783_control_list,
 	.num_controls	= ARRAY_SIZE(mc13783_control_list),
 	.dapm_widgets	= mc13783_dapm_widgets,
-- 
1.8.4.rc3

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH 2/3] mfd: mc13xxx: Move SPI erratum workaround into SPI I/O function
  2013-09-18 18:06 ` [PATCH 2/3] mfd: mc13xxx: Move SPI erratum workaround into SPI I/O function Mark Brown
@ 2013-09-19  9:13   ` Lee Jones
  2013-09-19  9:56     ` Mark Brown
  0 siblings, 1 reply; 18+ messages in thread
From: Lee Jones @ 2013-09-19  9:13 UTC (permalink / raw)
  To: Mark Brown
  Cc: Samuel Ortiz, Liam Girdwood, Marc Reilly, u.kleine-koenig,
	linux-kernel, alsa-devel, linaro-kernel, Mark Brown

On Wed, 18 Sep 2013, Mark Brown wrote:

> From: Mark Brown <broonie@linaro.org>
> 
> Move the workaround for double sending AUDIO_CODEC and AUDIO_DAC writes
> into the SPI core, aiding refactoring to eliminate the ASoC custom I/O
> functions and avoiding the extra writes for I2C.
> 
> Signed-off-by: Mark Brown <broonie@linaro.org>
> ---
>  drivers/mfd/mc13xxx-spi.c   | 5 +++++
>  include/linux/mfd/mc13xxx.h | 7 +++++++
>  sound/soc/codecs/mc13783.c  | 4 ----
>  3 files changed, 12 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/mfd/mc13xxx-spi.c b/drivers/mfd/mc13xxx-spi.c
> index 77189da..363c359 100644
> --- a/drivers/mfd/mc13xxx-spi.c
> +++ b/drivers/mfd/mc13xxx-spi.c
> @@ -94,10 +94,15 @@ static int mc13xxx_spi_write(void *context, const void *data, size_t count)
>  {
>  	struct device *dev = context;
>  	struct spi_device *spi = to_spi_device(dev);
> +	char *reg = data;

I think this requires a cast.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 2/3] mfd: mc13xxx: Move SPI erratum workaround into SPI I/O function
  2013-09-19  9:13   ` Lee Jones
@ 2013-09-19  9:56     ` Mark Brown
  2013-09-19 10:04       ` Lee Jones
  0 siblings, 1 reply; 18+ messages in thread
From: Mark Brown @ 2013-09-19  9:56 UTC (permalink / raw)
  To: Lee Jones
  Cc: alsa-devel, linaro-kernel, Samuel Ortiz, linux-kernel,
	Liam Girdwood, u.kleine-koenig, Marc Reilly


[-- Attachment #1.1: Type: text/plain, Size: 568 bytes --]

On Thu, Sep 19, 2013 at 10:13:18AM +0100, Lee Jones wrote:

Please delete irrelevant context from mails, it makes it easier to find
the new content that's beenn added.

> On Wed, 18 Sep 2013, Mark Brown wrote:

> > @@ -94,10 +94,15 @@ static int mc13xxx_spi_write(void *context, const void *data, size_t count)
> >  {
> >  	struct device *dev = context;
> >  	struct spi_device *spi = to_spi_device(dev);
> > +	char *reg = data;

> I think this requires a cast.

No, you should never need a cast to or from void in C - it probably does
want to be a const char though.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 2/3] mfd: mc13xxx: Move SPI erratum workaround into SPI I/O function
  2013-09-19  9:56     ` Mark Brown
@ 2013-09-19 10:04       ` Lee Jones
  2013-09-19 11:41         ` Mark Brown
  0 siblings, 1 reply; 18+ messages in thread
From: Lee Jones @ 2013-09-19 10:04 UTC (permalink / raw)
  To: Mark Brown
  Cc: Samuel Ortiz, Liam Girdwood, Marc Reilly, u.kleine-koenig,
	linux-kernel, alsa-devel, linaro-kernel

> Please delete irrelevant context from mails, it makes it easier to find
> the new content that's beenn added.

I did, off the bottom.

I only left 22 lines at the top. You're just being pernickety.

> > On Wed, 18 Sep 2013, Mark Brown wrote:
> 
> > > @@ -94,10 +94,15 @@ static int mc13xxx_spi_write(void *context, const void *data, size_t count)
> > >  {
> > >  	struct device *dev = context;
> > >  	struct spi_device *spi = to_spi_device(dev);
> > > +	char *reg = data;
> 
> > I think this requires a cast.
> 
> No, you should never need a cast to or from void in C - it probably does
> want to be a const char though.

Either way, it needs changing.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 2/3] mfd: mc13xxx: Move SPI erratum workaround into SPI I/O function
  2013-09-19 10:04       ` Lee Jones
@ 2013-09-19 11:41         ` Mark Brown
  2013-09-19 11:49           ` Lee Jones
  0 siblings, 1 reply; 18+ messages in thread
From: Mark Brown @ 2013-09-19 11:41 UTC (permalink / raw)
  To: Lee Jones
  Cc: Samuel Ortiz, Liam Girdwood, Marc Reilly, u.kleine-koenig,
	linux-kernel, alsa-devel, linaro-kernel

[-- Attachment #1: Type: text/plain, Size: 605 bytes --]

On Thu, Sep 19, 2013 at 11:04:34AM +0100, Lee Jones wrote:
> > Please delete irrelevant context from mails, it makes it easier to find
> > the new content that's beenn added.

> I did, off the bottom.

> I only left 22 lines at the top. You're just being pernickety.

I tend to say that when I end up having to page over more than a screen
or so of quote to find relevant stuff, especially if the useful content
is much smaller than the fluff (but really basically whenever it looks
like no trimming was done).

> Either way, it needs changing.

Let's see if someone actually tests the code first though.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 2/3] mfd: mc13xxx: Move SPI erratum workaround into SPI I/O function
  2013-09-19 11:41         ` Mark Brown
@ 2013-09-19 11:49           ` Lee Jones
  2013-09-19 12:09             ` Mark Brown
  0 siblings, 1 reply; 18+ messages in thread
From: Lee Jones @ 2013-09-19 11:49 UTC (permalink / raw)
  To: Mark Brown
  Cc: Samuel Ortiz, Liam Girdwood, Marc Reilly, u.kleine-koenig,
	linux-kernel, alsa-devel, linaro-kernel

> > Either way, it needs changing.
> 
> Let's see if someone actually tests the code first though.

I've taken the liberty of bulding it, but I don't have the h/w to
actually run the code.

I get:
  drivers/mfd/mc13xxx-spi.c: In function ‘mc13xxx_spi_write’:
  drivers/mfd/mc13xxx-spi.c:97:14: warning: initialisation discards ‘const’ qualifier from pointer target type [enabled by default]

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 2/3] mfd: mc13xxx: Move SPI erratum workaround into SPI I/O function
  2013-09-19 11:49           ` Lee Jones
@ 2013-09-19 12:09             ` Mark Brown
  0 siblings, 0 replies; 18+ messages in thread
From: Mark Brown @ 2013-09-19 12:09 UTC (permalink / raw)
  To: Lee Jones
  Cc: alsa-devel, linaro-kernel, Samuel Ortiz, linux-kernel,
	Liam Girdwood, u.kleine-koenig, Marc Reilly


[-- Attachment #1.1: Type: text/plain, Size: 549 bytes --]

On Thu, Sep 19, 2013 at 12:49:10PM +0100, Lee Jones wrote:
> > > Either way, it needs changing.

> > Let's see if someone actually tests the code first though.

> I've taken the liberty of bulding it, but I don't have the h/w to
> actually run the code.

> I get:
>   drivers/mfd/mc13xxx-spi.c: In function ‘mc13xxx_spi_write’:
>   drivers/mfd/mc13xxx-spi.c:97:14: warning: initialisation discards ‘const’ qualifier from pointer target type [enabled by default]

Sure, but like I say let's see if the code actually works first.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 2/3] mfd: mc13xxx: Move SPI erratum workaround into SPI I/O function
  2013-09-25 12:55               ` Mark Brown
@ 2013-09-25 13:05                 ` Lee Jones
  0 siblings, 0 replies; 18+ messages in thread
From: Lee Jones @ 2013-09-25 13:05 UTC (permalink / raw)
  To: Mark Brown; +Cc: Samuel Ortiz, alsa-devel, linux-kernel, linaro-kernel

On Wed, 25 Sep 2013, Mark Brown wrote:

> On Wed, Sep 25, 2013 at 01:51:39PM +0100, Lee Jones wrote:
> > On Wed, 25 Sep 2013, Mark Brown wrote:
> > > On Wed, Sep 25, 2013 at 12:55:02PM +0100, Lee Jones wrote:
> 
> > > > https://git.linaro.org/gitweb?p=people/ljones/mfd.git mfd-asoc
> 
> > > Thanks, could you include the first patch as well please (there's a
> > > dependency for bisection due to the BUG_ONs)? 
> 
> > Okay, done. Same branch.
> 
> Pulled, thanks.  That URI isn't directly pullable BTW.

I know.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 2/3] mfd: mc13xxx: Move SPI erratum workaround into SPI I/O function
  2013-09-25 12:51             ` Lee Jones
@ 2013-09-25 12:55               ` Mark Brown
  2013-09-25 13:05                 ` Lee Jones
  0 siblings, 1 reply; 18+ messages in thread
From: Mark Brown @ 2013-09-25 12:55 UTC (permalink / raw)
  To: Lee Jones; +Cc: alsa-devel, linaro-kernel, Samuel Ortiz, linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 453 bytes --]

On Wed, Sep 25, 2013 at 01:51:39PM +0100, Lee Jones wrote:
> On Wed, 25 Sep 2013, Mark Brown wrote:
> > On Wed, Sep 25, 2013 at 12:55:02PM +0100, Lee Jones wrote:

> > > https://git.linaro.org/gitweb?p=people/ljones/mfd.git mfd-asoc

> > Thanks, could you include the first patch as well please (there's a
> > dependency for bisection due to the BUG_ONs)? 

> Okay, done. Same branch.

Pulled, thanks.  That URI isn't directly pullable BTW.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 2/3] mfd: mc13xxx: Move SPI erratum workaround into SPI I/O function
  2013-09-25 12:35           ` Mark Brown
@ 2013-09-25 12:51             ` Lee Jones
  2013-09-25 12:55               ` Mark Brown
  0 siblings, 1 reply; 18+ messages in thread
From: Lee Jones @ 2013-09-25 12:51 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel, linaro-kernel, Samuel Ortiz, linux-kernel

On Wed, 25 Sep 2013, Mark Brown wrote:

> On Wed, Sep 25, 2013 at 12:55:02PM +0100, Lee Jones wrote:
> 
> > https://git.linaro.org/gitweb?p=people/ljones/mfd.git mfd-asoc
> 
> Thanks, could you include the first patch as well please (there's a
> dependency for bisection due to the BUG_ONs)? 

Okay, done. Same branch.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 2/3] mfd: mc13xxx: Move SPI erratum workaround into SPI I/O function
  2013-09-25 11:55         ` Lee Jones
@ 2013-09-25 12:35           ` Mark Brown
  2013-09-25 12:51             ` Lee Jones
  0 siblings, 1 reply; 18+ messages in thread
From: Mark Brown @ 2013-09-25 12:35 UTC (permalink / raw)
  To: Lee Jones; +Cc: alsa-devel, linaro-kernel, Samuel Ortiz, linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 247 bytes --]

On Wed, Sep 25, 2013 at 12:55:02PM +0100, Lee Jones wrote:

> https://git.linaro.org/gitweb?p=people/ljones/mfd.git mfd-asoc

Thanks, could you include the first patch as well please (there's a
dependency for bisection due to the BUG_ONs)? 

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 2/3] mfd: mc13xxx: Move SPI erratum workaround into SPI I/O function
  2013-09-25 11:46       ` Lee Jones
@ 2013-09-25 11:55         ` Lee Jones
  2013-09-25 12:35           ` Mark Brown
  0 siblings, 1 reply; 18+ messages in thread
From: Lee Jones @ 2013-09-25 11:55 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel, linaro-kernel, Samuel Ortiz, linux-kernel

On Wed, 25 Sep 2013, Lee Jones wrote:

> On Wed, 25 Sep 2013, Mark Brown wrote:
> 
> > On Wed, Sep 25, 2013 at 12:19:54PM +0100, Lee Jones wrote:
> > 
> > > I assume this is okay to go in via the MFD tree.
> > 
> > > I've applied it until you say otherwise.
> > 
> > Can you please put it on a branch I can pull into ASoC in case we manage
> > to get rid of all the other users this cycle?
> 
> Yes, I can do that.

https://git.linaro.org/gitweb?p=people/ljones/mfd.git mfd-asoc

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 2/3] mfd: mc13xxx: Move SPI erratum workaround into SPI I/O function
  2013-09-25 11:31     ` Mark Brown
@ 2013-09-25 11:46       ` Lee Jones
  2013-09-25 11:55         ` Lee Jones
  0 siblings, 1 reply; 18+ messages in thread
From: Lee Jones @ 2013-09-25 11:46 UTC (permalink / raw)
  To: Mark Brown; +Cc: Samuel Ortiz, alsa-devel, linux-kernel, linaro-kernel

On Wed, 25 Sep 2013, Mark Brown wrote:

> On Wed, Sep 25, 2013 at 12:19:54PM +0100, Lee Jones wrote:
> 
> > I assume this is okay to go in via the MFD tree.
> 
> > I've applied it until you say otherwise.
> 
> Can you please put it on a branch I can pull into ASoC in case we manage
> to get rid of all the other users this cycle?

Yes, I can do that.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 2/3] mfd: mc13xxx: Move SPI erratum workaround into SPI I/O function
  2013-09-25 11:19   ` Lee Jones
@ 2013-09-25 11:31     ` Mark Brown
  2013-09-25 11:46       ` Lee Jones
  0 siblings, 1 reply; 18+ messages in thread
From: Mark Brown @ 2013-09-25 11:31 UTC (permalink / raw)
  To: Lee Jones; +Cc: alsa-devel, linaro-kernel, Samuel Ortiz, linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 275 bytes --]

On Wed, Sep 25, 2013 at 12:19:54PM +0100, Lee Jones wrote:

> I assume this is okay to go in via the MFD tree.

> I've applied it until you say otherwise.

Can you please put it on a branch I can pull into ASoC in case we manage
to get rid of all the other users this cycle?

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 2/3] mfd: mc13xxx: Move SPI erratum workaround into SPI I/O function
  2013-09-23 18:14 ` [PATCH 2/3] mfd: mc13xxx: Move SPI erratum workaround into SPI I/O function Mark Brown
@ 2013-09-25 11:19   ` Lee Jones
  2013-09-25 11:31     ` Mark Brown
  0 siblings, 1 reply; 18+ messages in thread
From: Lee Jones @ 2013-09-25 11:19 UTC (permalink / raw)
  To: Mark Brown
  Cc: Samuel Ortiz, alsa-devel, linux-kernel, linaro-kernel, Mark Brown

On Mon, 23 Sep 2013, Mark Brown wrote:

> From: Mark Brown <broonie@linaro.org>
> 
> Move the workaround for double sending AUDIO_CODEC and AUDIO_DAC writes
> into the SPI core, aiding refactoring to eliminate the ASoC custom I/O
> functions and avoiding the extra writes for I2C.
> 
> Signed-off-by: Mark Brown <broonie@linaro.org>
> ---
>  drivers/mfd/mc13xxx-spi.c   | 5 +++++
>  include/linux/mfd/mc13xxx.h | 7 +++++++
>  sound/soc/codecs/mc13783.c  | 4 ----
>  3 files changed, 12 insertions(+), 4 deletions(-)

I assume this is okay to go in via the MFD tree.

I've applied it until you say otherwise.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 2/3] mfd: mc13xxx: Move SPI erratum workaround into SPI I/O function
  2013-09-23 18:14 [PATCH 1/3] mfd: mc13xxx: Don't require lock for simple register I/O Mark Brown
@ 2013-09-23 18:14 ` Mark Brown
  2013-09-25 11:19   ` Lee Jones
  0 siblings, 1 reply; 18+ messages in thread
From: Mark Brown @ 2013-09-23 18:14 UTC (permalink / raw)
  To: Lee Jones, Samuel Ortiz
  Cc: alsa-devel, linaro-kernel, linux-kernel, Mark Brown

From: Mark Brown <broonie@linaro.org>

Move the workaround for double sending AUDIO_CODEC and AUDIO_DAC writes
into the SPI core, aiding refactoring to eliminate the ASoC custom I/O
functions and avoiding the extra writes for I2C.

Signed-off-by: Mark Brown <broonie@linaro.org>
---
 drivers/mfd/mc13xxx-spi.c   | 5 +++++
 include/linux/mfd/mc13xxx.h | 7 +++++++
 sound/soc/codecs/mc13783.c  | 4 ----
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/mc13xxx-spi.c b/drivers/mfd/mc13xxx-spi.c
index 77189da..5f14ef6 100644
--- a/drivers/mfd/mc13xxx-spi.c
+++ b/drivers/mfd/mc13xxx-spi.c
@@ -94,10 +94,15 @@ static int mc13xxx_spi_write(void *context, const void *data, size_t count)
 {
 	struct device *dev = context;
 	struct spi_device *spi = to_spi_device(dev);
+	const char *reg = data;
 
 	if (count != 4)
 		return -ENOTSUPP;
 
+	/* include errata fix for spi audio problems */
+	if (*reg == MC13783_AUDIO_CODEC || *reg == MC13783_AUDIO_DAC)
+		spi_write(spi, data, count);
+
 	return spi_write(spi, data, count);
 }
 
diff --git a/include/linux/mfd/mc13xxx.h b/include/linux/mfd/mc13xxx.h
index 41ed592..67c17b5 100644
--- a/include/linux/mfd/mc13xxx.h
+++ b/include/linux/mfd/mc13xxx.h
@@ -41,6 +41,13 @@ int mc13xxx_adc_do_conversion(struct mc13xxx *mc13xxx,
 		unsigned int mode, unsigned int channel,
 		u8 ato, bool atox, unsigned int *sample);
 
+#define MC13783_AUDIO_RX0	36
+#define MC13783_AUDIO_RX1	37
+#define MC13783_AUDIO_TX	38
+#define MC13783_SSI_NETWORK	39
+#define MC13783_AUDIO_CODEC	40
+#define MC13783_AUDIO_DAC	41
+
 #define MC13XXX_IRQ_ADCDONE	0
 #define MC13XXX_IRQ_ADCBISDONE	1
 #define MC13XXX_IRQ_TS		2
diff --git a/sound/soc/codecs/mc13783.c b/sound/soc/codecs/mc13783.c
index ea141e1..4d3c8fd 100644
--- a/sound/soc/codecs/mc13783.c
+++ b/sound/soc/codecs/mc13783.c
@@ -125,10 +125,6 @@ static int mc13783_write(struct snd_soc_codec *codec,
 
 	ret = mc13xxx_reg_write(priv->mc13xxx, reg, value);
 
-	/* include errata fix for spi audio problems */
-	if (reg == MC13783_AUDIO_CODEC || reg == MC13783_AUDIO_DAC)
-		ret = mc13xxx_reg_write(priv->mc13xxx, reg, value);
-
 	mc13xxx_unlock(priv->mc13xxx);
 
 	return ret;
-- 
1.8.4.rc3

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2013-09-25 13:05 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-18 18:06 [PATCH 1/3] mfd: mc13xxx: Don't require lock for simple register I/O Mark Brown
2013-09-18 18:06 ` [PATCH 2/3] mfd: mc13xxx: Move SPI erratum workaround into SPI I/O function Mark Brown
2013-09-19  9:13   ` Lee Jones
2013-09-19  9:56     ` Mark Brown
2013-09-19 10:04       ` Lee Jones
2013-09-19 11:41         ` Mark Brown
2013-09-19 11:49           ` Lee Jones
2013-09-19 12:09             ` Mark Brown
2013-09-18 18:06 ` [PATCH 3/3] ASoC: mc13783: Use regmap directly from ASoC Mark Brown
2013-09-23 18:14 [PATCH 1/3] mfd: mc13xxx: Don't require lock for simple register I/O Mark Brown
2013-09-23 18:14 ` [PATCH 2/3] mfd: mc13xxx: Move SPI erratum workaround into SPI I/O function Mark Brown
2013-09-25 11:19   ` Lee Jones
2013-09-25 11:31     ` Mark Brown
2013-09-25 11:46       ` Lee Jones
2013-09-25 11:55         ` Lee Jones
2013-09-25 12:35           ` Mark Brown
2013-09-25 12:51             ` Lee Jones
2013-09-25 12:55               ` Mark Brown
2013-09-25 13:05                 ` Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).