All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA: ASoC: ak4104: add reset line property to DT bindings
@ 2012-11-14 10:28 Daniel Mack
  2012-11-14 10:43 ` Mark Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Mack @ 2012-11-14 10:28 UTC (permalink / raw)
  To: alsa-devel; +Cc: broonie, Daniel Mack

This device doesn't have a pdata definition for legacy boards, and
unless anyone need to control the reset GPIO, it's not worth adding one.
So this feature is only available to DT users for now.

Signed-off-by: Daniel Mack <zonque@gmail.com>
---
 Documentation/devicetree/bindings/sound/ak4104.txt |  5 +++++
 sound/soc/codecs/ak4104.c                          | 17 +++++++++++++++++
 2 files changed, 22 insertions(+)

diff --git a/Documentation/devicetree/bindings/sound/ak4104.txt b/Documentation/devicetree/bindings/sound/ak4104.txt
index 1f8e506..b902ee3 100644
--- a/Documentation/devicetree/bindings/sound/ak4104.txt
+++ b/Documentation/devicetree/bindings/sound/ak4104.txt
@@ -8,6 +8,11 @@ Required properties:
 
   - reg : The chip select number on the SPI bus
 
+Optional properties:
+
+  - reset-gpio : a GPIO spec for the reset pin. If specified, it will be
+		 deasserted before communication to the device starts.
+
 Example:
 
 spdif: ak4104@0 {
diff --git a/sound/soc/codecs/ak4104.c b/sound/soc/codecs/ak4104.c
index d4d4858..eec086b 100644
--- a/sound/soc/codecs/ak4104.c
+++ b/sound/soc/codecs/ak4104.c
@@ -15,6 +15,8 @@
 #include <sound/soc.h>
 #include <sound/initval.h>
 #include <linux/spi/spi.h>
+#include <linux/of_device.h>
+#include <linux/of_gpio.h>
 #include <sound/asoundef.h>
 
 /* AK4104 registers addresses */
@@ -204,6 +206,7 @@ static const struct regmap_config ak4104_regmap = {
 
 static int ak4104_spi_probe(struct spi_device *spi)
 {
+	struct device_node *np = spi->dev.of_node;
 	struct ak4104_private *ak4104;
 	unsigned int val;
 	int ret;
@@ -225,6 +228,20 @@ static int ak4104_spi_probe(struct spi_device *spi)
 		return ret;
 	}
 
+	if (np) {
+		enum of_gpio_flags flags;
+		int gpio = of_get_named_gpio_flags(np, "reset-gpio", 0, &flags);
+
+		if (gpio_is_valid(gpio)) {
+			ret = devm_gpio_request_one(&spi->dev, gpio,
+				     flags & OF_GPIO_ACTIVE_LOW ?
+					GPIOF_OUT_INIT_LOW : GPIOF_OUT_INIT_HIGH,
+				     "ak4104 reset");
+			if (ret < 0)
+				return ret;
+		}
+	}
+
 	/* read the 'reserved' register - according to the datasheet, it
 	 * should contain 0x5b. Not a good way to verify the presence of
 	 * the device, but there is no hardware ID register. */
-- 
1.7.11.7

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

* Re: [PATCH] ALSA: ASoC: ak4104: add reset line property to DT bindings
  2012-11-14 10:28 [PATCH] ALSA: ASoC: ak4104: add reset line property to DT bindings Daniel Mack
@ 2012-11-14 10:43 ` Mark Brown
  2012-11-14 10:54   ` Daniel Mack
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2012-11-14 10:43 UTC (permalink / raw)
  To: Daniel Mack; +Cc: alsa-devel


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

On Wed, Nov 14, 2012 at 06:28:39PM +0800, Daniel Mack wrote:
> This device doesn't have a pdata definition for legacy boards, and
> unless anyone need to control the reset GPIO, it's not worth adding one.
> So this feature is only available to DT users for now.
> 
> Signed-off-by: Daniel Mack <zonque@gmail.com>
> ---
>  Documentation/devicetree/bindings/sound/ak4104.txt |  5 +++++

This doesn't apply, the bindings file doesn't exist in mainline or -next
- probably an earlier patch you forgot to submit.

[-- 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] 5+ messages in thread

* Re: [PATCH] ALSA: ASoC: ak4104: add reset line property to DT bindings
  2012-11-14 10:43 ` Mark Brown
@ 2012-11-14 10:54   ` Daniel Mack
  2012-11-14 10:57     ` Mark Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Mack @ 2012-11-14 10:54 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel

On Wed, Nov 14, 2012 at 6:43 PM, Mark Brown
<broonie@opensource.wolfsonmicro.com> wrote:
> On Wed, Nov 14, 2012 at 06:28:39PM +0800, Daniel Mack wrote:
>> This device doesn't have a pdata definition for legacy boards, and
>> unless anyone need to control the reset GPIO, it's not worth adding one.
>> So this feature is only available to DT users for now.
>>
>> Signed-off-by: Daniel Mack <zonque@gmail.com>
>> ---
>>  Documentation/devicetree/bindings/sound/ak4104.txt |  5 +++++
>
> This doesn't apply, the bindings file doesn't exist in mainline or -next
> - probably an earlier patch you forgot to submit.

I submitted that some weeks ago - it's in your topic/ak4104 branch :)

  https://git.kernel.org/?p=linux/kernel/git/broonie/sound.git;a=commit;h=ac5dbea

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

* Re: [PATCH] ALSA: ASoC: ak4104: add reset line property to DT bindings
  2012-11-14 10:54   ` Daniel Mack
@ 2012-11-14 10:57     ` Mark Brown
  2012-11-14 11:03       ` Daniel Mack
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2012-11-14 10:57 UTC (permalink / raw)
  To: Daniel Mack; +Cc: alsa-devel


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

On Wed, Nov 14, 2012 at 06:54:12PM +0800, Daniel Mack wrote:
> On Wed, Nov 14, 2012 at 6:43 PM, Mark Brown

> > This doesn't apply, the bindings file doesn't exist in mainline or -next
> > - probably an earlier patch you forgot to submit.

> I submitted that some weeks ago - it's in your topic/ak4104 branch :)

>   https://git.kernel.org/?p=linux/kernel/git/broonie/sound.git;a=commit;h=ac5dbea

I don't appear to have any such branch locally...  wonder where that
went.

[-- 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] 5+ messages in thread

* Re: [PATCH] ALSA: ASoC: ak4104: add reset line property to DT bindings
  2012-11-14 10:57     ` Mark Brown
@ 2012-11-14 11:03       ` Daniel Mack
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Mack @ 2012-11-14 11:03 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel

On Wed, Nov 14, 2012 at 6:57 PM, Mark Brown
<broonie@opensource.wolfsonmicro.com> wrote:
> On Wed, Nov 14, 2012 at 06:54:12PM +0800, Daniel Mack wrote:
>> On Wed, Nov 14, 2012 at 6:43 PM, Mark Brown
>
>> > This doesn't apply, the bindings file doesn't exist in mainline or -next
>> > - probably an earlier patch you forgot to submit.
>
>> I submitted that some weeks ago - it's in your topic/ak4104 branch :)
>
>>   https://git.kernel.org/?p=linux/kernel/git/broonie/sound.git;a=commit;h=ac5dbea
>
> I don't appear to have any such branch locally...  wonder where that
> went.

I was refering to your remote branch of course:

https://git.kernel.org/?p=linux/kernel/git/broonie/sound.git;a=shortlog;h=refs/heads/topic/ak4104

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

end of thread, other threads:[~2012-11-14 11:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-14 10:28 [PATCH] ALSA: ASoC: ak4104: add reset line property to DT bindings Daniel Mack
2012-11-14 10:43 ` Mark Brown
2012-11-14 10:54   ` Daniel Mack
2012-11-14 10:57     ` Mark Brown
2012-11-14 11:03       ` Daniel Mack

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.