[alsa-devel] [PATCH v2 1/4] ASoC: sun4i-codec: Rename codec dapm widgets and routes
Rename the codec dapm widgets and routes with a _codec prefix. This is a preparation patch for adding card dapm widgets and routes.
Signed-off-by: Hans de Goede hdegoede@redhat.com --- Changes in v2: -New patch in v2 of this patchset --- sound/soc/sunxi/sun4i-codec.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c index 7a3fe1d..519ccb3 100644 --- a/sound/soc/sunxi/sun4i-codec.c +++ b/sound/soc/sunxi/sun4i-codec.c @@ -532,7 +532,7 @@ static const struct snd_kcontrol_new sun4i_codec_pa_mixer_controls[] = { SUN4I_CODEC_DAC_ACTL_MIXPAS, 1, 0), };
-static const struct snd_soc_dapm_widget sun4i_codec_dapm_widgets[] = { +static const struct snd_soc_dapm_widget sun4i_codec_codec_dapm_widgets[] = { /* Digital parts of the ADCs */ SND_SOC_DAPM_SUPPLY("ADC", SUN4I_CODEC_ADC_FIFOC, SUN4I_CODEC_ADC_FIFOC_EN_AD, 0, @@ -589,7 +589,7 @@ static const struct snd_soc_dapm_widget sun4i_codec_dapm_widgets[] = { SND_SOC_DAPM_OUTPUT("HP Left"), };
-static const struct snd_soc_dapm_route sun4i_codec_dapm_routes[] = { +static const struct snd_soc_dapm_route sun4i_codec_codec_dapm_routes[] = { /* Left ADC / DAC Routes */ { "Left ADC", NULL, "ADC" }, { "Left DAC", NULL, "DAC" }, @@ -628,10 +628,10 @@ static const struct snd_soc_dapm_route sun4i_codec_dapm_routes[] = { static struct snd_soc_codec_driver sun4i_codec_codec = { .controls = sun4i_codec_widgets, .num_controls = ARRAY_SIZE(sun4i_codec_widgets), - .dapm_widgets = sun4i_codec_dapm_widgets, - .num_dapm_widgets = ARRAY_SIZE(sun4i_codec_dapm_widgets), - .dapm_routes = sun4i_codec_dapm_routes, - .num_dapm_routes = ARRAY_SIZE(sun4i_codec_dapm_routes), + .dapm_widgets = sun4i_codec_codec_dapm_widgets, + .num_dapm_widgets = ARRAY_SIZE(sun4i_codec_codec_dapm_widgets), + .dapm_routes = sun4i_codec_codec_dapm_routes, + .num_dapm_routes = ARRAY_SIZE(sun4i_codec_codec_dapm_routes), };
static const struct snd_soc_component_driver sun4i_codec_component = {
Add support for PA gpio pin for controlling an external amplifier as used on some Allwinner boards.
Signed-off-by: Hans de Goede hdegoede@redhat.com --- Changes in v2: -Use a dapm speaker widget (SND_SOC_DAPM_SPK) to control the gpio -Rename gpio in devicetree from pa-gpios to allwinner,pa-gpios --- .../devicetree/bindings/sound/sun4i-codec.txt | 3 ++ sound/soc/sunxi/sun4i-codec.c | 35 ++++++++++++++++++++++ 2 files changed, 38 insertions(+)
diff --git a/Documentation/devicetree/bindings/sound/sun4i-codec.txt b/Documentation/devicetree/bindings/sound/sun4i-codec.txt index c92966b..0dce690 100644 --- a/Documentation/devicetree/bindings/sound/sun4i-codec.txt +++ b/Documentation/devicetree/bindings/sound/sun4i-codec.txt @@ -14,6 +14,9 @@ Required properties: - "apb": the parent APB clock for this controller - "codec": the parent module clock
+Optional properties: +- allwinner,pa-gpios: gpio to enable external amplifier + Example: codec: codec@01c22c00 { #sound-dai-cells = <0>; diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c index 519ccb3..e6cc6a1 100644 --- a/sound/soc/sunxi/sun4i-codec.c +++ b/sound/soc/sunxi/sun4i-codec.c @@ -28,6 +28,7 @@ #include <linux/of_address.h> #include <linux/clk.h> #include <linux/regmap.h> +#include <linux/gpio/consumer.h>
#include <sound/core.h> #include <sound/pcm.h> @@ -103,6 +104,7 @@ struct sun4i_codec { struct regmap *regmap; struct clk *clk_apb; struct clk *clk_module; + struct gpio_desc *gpio_pa;
struct snd_dmaengine_dai_dma_data capture_dma_data; struct snd_dmaengine_dai_dma_data playback_dma_data; @@ -709,6 +711,26 @@ static struct snd_soc_dai_link *sun4i_codec_create_link(struct device *dev, return link; };
+static int sun4i_codec_spk_event(struct snd_soc_dapm_widget *w, + struct snd_kcontrol *k, int event) +{ + struct sun4i_codec *scodec = snd_soc_card_get_drvdata(w->dapm->card); + + if (scodec->gpio_pa) + gpiod_set_value_cansleep(scodec->gpio_pa, + !!SND_SOC_DAPM_EVENT_ON(event)); + + return 0; +} + +static const struct snd_soc_dapm_widget sun4i_codec_card_dapm_widgets[] = { + SND_SOC_DAPM_SPK("Speaker", sun4i_codec_spk_event), +}; + +static const struct snd_soc_dapm_route sun4i_codec_card_dapm_routes[] = { + { "Speaker", NULL, "Power Amplifier" }, +}; + static struct snd_soc_card *sun4i_codec_create_card(struct device *dev) { struct snd_soc_card *card; @@ -723,6 +745,10 @@ static struct snd_soc_card *sun4i_codec_create_card(struct device *dev)
card->dev = dev; card->name = "sun4i-codec"; + card->dapm_widgets = sun4i_codec_card_dapm_widgets; + card->num_dapm_widgets = ARRAY_SIZE(sun4i_codec_card_dapm_widgets); + card->dapm_routes = sun4i_codec_card_dapm_routes; + card->num_dapm_routes = ARRAY_SIZE(sun4i_codec_card_dapm_routes);
return card; }; @@ -774,6 +800,15 @@ static int sun4i_codec_probe(struct platform_device *pdev) return -EINVAL; }
+ scodec->gpio_pa = devm_gpiod_get_optional(&pdev->dev, "allwinner,pa", + GPIOD_OUT_LOW); + if (IS_ERR(scodec->gpio_pa)) { + ret = PTR_ERR(scodec->gpio_pa); + if (ret != -EPROBE_DEFER) + dev_err(&pdev->dev, "Failed to get pa gpio: %d\n", ret); + return ret; + } + /* DMA configuration for TX FIFO */ scodec->playback_dma_data.addr = res->start + SUN4I_CODEC_DAC_TXDATA; scodec->playback_dma_data.maxburst = 4;
On Fri, Dec 11, 2015 at 07:43:57PM +0100, Hans de Goede wrote:
gpiod_set_value_cansleep(scodec->gpio_pa,
!!SND_SOC_DAPM_EVENT_ON(event));
Why the double negation here? The macro is already supposed to give you a boolean and gpiod_set_value_cansleep() ought to cope with a C logic value.
The patch
ASoC: sun4i-codec: Add support for PA gpio pin
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks, Mark
From 405926276bfb316915c16e57a3943eb2cf4dd8fa Mon Sep 17 00:00:00 2001
From: Hans de Goede hdegoede@redhat.com Date: Fri, 11 Dec 2015 19:43:57 +0100 Subject: [PATCH] ASoC: sun4i-codec: Add support for PA gpio pin
Add support for PA gpio pin for controlling an external amplifier as used on some Allwinner boards.
Signed-off-by: Hans de Goede hdegoede@redhat.com Signed-off-by: Mark Brown broonie@kernel.org --- .../devicetree/bindings/sound/sun4i-codec.txt | 3 ++ sound/soc/sunxi/sun4i-codec.c | 35 ++++++++++++++++++++++ 2 files changed, 38 insertions(+)
diff --git a/Documentation/devicetree/bindings/sound/sun4i-codec.txt b/Documentation/devicetree/bindings/sound/sun4i-codec.txt index c92966b..0dce690 100644 --- a/Documentation/devicetree/bindings/sound/sun4i-codec.txt +++ b/Documentation/devicetree/bindings/sound/sun4i-codec.txt @@ -14,6 +14,9 @@ Required properties: - "apb": the parent APB clock for this controller - "codec": the parent module clock
+Optional properties: +- allwinner,pa-gpios: gpio to enable external amplifier + Example: codec: codec@01c22c00 { #sound-dai-cells = <0>; diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c index 519ccb3..e6cc6a1 100644 --- a/sound/soc/sunxi/sun4i-codec.c +++ b/sound/soc/sunxi/sun4i-codec.c @@ -28,6 +28,7 @@ #include <linux/of_address.h> #include <linux/clk.h> #include <linux/regmap.h> +#include <linux/gpio/consumer.h>
#include <sound/core.h> #include <sound/pcm.h> @@ -103,6 +104,7 @@ struct sun4i_codec { struct regmap *regmap; struct clk *clk_apb; struct clk *clk_module; + struct gpio_desc *gpio_pa;
struct snd_dmaengine_dai_dma_data capture_dma_data; struct snd_dmaengine_dai_dma_data playback_dma_data; @@ -709,6 +711,26 @@ static struct snd_soc_dai_link *sun4i_codec_create_link(struct device *dev, return link; };
+static int sun4i_codec_spk_event(struct snd_soc_dapm_widget *w, + struct snd_kcontrol *k, int event) +{ + struct sun4i_codec *scodec = snd_soc_card_get_drvdata(w->dapm->card); + + if (scodec->gpio_pa) + gpiod_set_value_cansleep(scodec->gpio_pa, + !!SND_SOC_DAPM_EVENT_ON(event)); + + return 0; +} + +static const struct snd_soc_dapm_widget sun4i_codec_card_dapm_widgets[] = { + SND_SOC_DAPM_SPK("Speaker", sun4i_codec_spk_event), +}; + +static const struct snd_soc_dapm_route sun4i_codec_card_dapm_routes[] = { + { "Speaker", NULL, "Power Amplifier" }, +}; + static struct snd_soc_card *sun4i_codec_create_card(struct device *dev) { struct snd_soc_card *card; @@ -723,6 +745,10 @@ static struct snd_soc_card *sun4i_codec_create_card(struct device *dev)
card->dev = dev; card->name = "sun4i-codec"; + card->dapm_widgets = sun4i_codec_card_dapm_widgets; + card->num_dapm_widgets = ARRAY_SIZE(sun4i_codec_card_dapm_widgets); + card->dapm_routes = sun4i_codec_card_dapm_routes; + card->num_dapm_routes = ARRAY_SIZE(sun4i_codec_card_dapm_routes);
return card; }; @@ -774,6 +800,15 @@ static int sun4i_codec_probe(struct platform_device *pdev) return -EINVAL; }
+ scodec->gpio_pa = devm_gpiod_get_optional(&pdev->dev, "allwinner,pa", + GPIOD_OUT_LOW); + if (IS_ERR(scodec->gpio_pa)) { + ret = PTR_ERR(scodec->gpio_pa); + if (ret != -EPROBE_DEFER) + dev_err(&pdev->dev, "Failed to get pa gpio: %d\n", ret); + return ret; + } + /* DMA configuration for TX FIFO */ scodec->playback_dma_data.addr = res->start + SUN4I_CODEC_DAC_TXDATA; scodec->playback_dma_data.maxburst = 4;
On Fri, Dec 11, 2015 at 07:43:57PM +0100, Hans de Goede wrote:
Add support for PA gpio pin for controlling an external amplifier as used on some Allwinner boards.
Signed-off-by: Hans de Goede hdegoede@redhat.com
Acked-by: Rob Herring robh@kernel.org
Changes in v2: -Use a dapm speaker widget (SND_SOC_DAPM_SPK) to control the gpio
-Rename gpio in devicetree from pa-gpios to allwinner,pa-gpios
.../devicetree/bindings/sound/sun4i-codec.txt | 3 ++ sound/soc/sunxi/sun4i-codec.c | 35 ++++++++++++++++++++++ 2 files changed, 38 insertions(+)
diff --git a/Documentation/devicetree/bindings/sound/sun4i-codec.txt b/Documentation/devicetree/bindings/sound/sun4i-codec.txt index c92966b..0dce690 100644 --- a/Documentation/devicetree/bindings/sound/sun4i-codec.txt +++ b/Documentation/devicetree/bindings/sound/sun4i-codec.txt @@ -14,6 +14,9 @@ Required properties: - "apb": the parent APB clock for this controller - "codec": the parent module clock
+Optional properties: +- allwinner,pa-gpios: gpio to enable external amplifier
Example: codec: codec@01c22c00 { #sound-dai-cells = <0>; diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c index 519ccb3..e6cc6a1 100644 --- a/sound/soc/sunxi/sun4i-codec.c +++ b/sound/soc/sunxi/sun4i-codec.c @@ -28,6 +28,7 @@ #include <linux/of_address.h> #include <linux/clk.h> #include <linux/regmap.h> +#include <linux/gpio/consumer.h>
#include <sound/core.h> #include <sound/pcm.h> @@ -103,6 +104,7 @@ struct sun4i_codec { struct regmap *regmap; struct clk *clk_apb; struct clk *clk_module;
struct gpio_desc *gpio_pa;
struct snd_dmaengine_dai_dma_data capture_dma_data; struct snd_dmaengine_dai_dma_data playback_dma_data;
@@ -709,6 +711,26 @@ static struct snd_soc_dai_link *sun4i_codec_create_link(struct device *dev, return link; };
+static int sun4i_codec_spk_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *k, int event)
+{
- struct sun4i_codec *scodec = snd_soc_card_get_drvdata(w->dapm->card);
- if (scodec->gpio_pa)
gpiod_set_value_cansleep(scodec->gpio_pa,
!!SND_SOC_DAPM_EVENT_ON(event));
- return 0;
+}
+static const struct snd_soc_dapm_widget sun4i_codec_card_dapm_widgets[] = {
- SND_SOC_DAPM_SPK("Speaker", sun4i_codec_spk_event),
+};
+static const struct snd_soc_dapm_route sun4i_codec_card_dapm_routes[] = {
- { "Speaker", NULL, "Power Amplifier" },
+};
static struct snd_soc_card *sun4i_codec_create_card(struct device *dev) { struct snd_soc_card *card; @@ -723,6 +745,10 @@ static struct snd_soc_card *sun4i_codec_create_card(struct device *dev)
card->dev = dev; card->name = "sun4i-codec";
card->dapm_widgets = sun4i_codec_card_dapm_widgets;
card->num_dapm_widgets = ARRAY_SIZE(sun4i_codec_card_dapm_widgets);
card->dapm_routes = sun4i_codec_card_dapm_routes;
card->num_dapm_routes = ARRAY_SIZE(sun4i_codec_card_dapm_routes);
return card;
}; @@ -774,6 +800,15 @@ static int sun4i_codec_probe(struct platform_device *pdev) return -EINVAL; }
- scodec->gpio_pa = devm_gpiod_get_optional(&pdev->dev, "allwinner,pa",
GPIOD_OUT_LOW);
- if (IS_ERR(scodec->gpio_pa)) {
ret = PTR_ERR(scodec->gpio_pa);
if (ret != -EPROBE_DEFER)
dev_err(&pdev->dev, "Failed to get pa gpio: %d\n", ret);
return ret;
- }
- /* DMA configuration for TX FIFO */ scodec->playback_dma_data.addr = res->start + SUN4I_CODEC_DAC_TXDATA; scodec->playback_dma_data.maxburst = 4;
-- 2.5.0
-- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi,
On Fri, Dec 11, 2015 at 07:43:57PM +0100, Hans de Goede wrote:
Add support for PA gpio pin for controlling an external amplifier as used on some Allwinner boards.
Signed-off-by: Hans de Goede hdegoede@redhat.com
Changes in v2: -Use a dapm speaker widget (SND_SOC_DAPM_SPK) to control the gpio
-Rename gpio in devicetree from pa-gpios to allwinner,pa-gpios
.../devicetree/bindings/sound/sun4i-codec.txt | 3 ++ sound/soc/sunxi/sun4i-codec.c | 35 ++++++++++++++++++++++ 2 files changed, 38 insertions(+)
diff --git a/Documentation/devicetree/bindings/sound/sun4i-codec.txt b/Documentation/devicetree/bindings/sound/sun4i-codec.txt index c92966b..0dce690 100644 --- a/Documentation/devicetree/bindings/sound/sun4i-codec.txt +++ b/Documentation/devicetree/bindings/sound/sun4i-codec.txt @@ -14,6 +14,9 @@ Required properties: - "apb": the parent APB clock for this controller - "codec": the parent module clock
+Optional properties: +- allwinner,pa-gpios: gpio to enable external amplifier
Example: codec: codec@01c22c00 { #sound-dai-cells = <0>; diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c index 519ccb3..e6cc6a1 100644 --- a/sound/soc/sunxi/sun4i-codec.c +++ b/sound/soc/sunxi/sun4i-codec.c @@ -28,6 +28,7 @@ #include <linux/of_address.h> #include <linux/clk.h> #include <linux/regmap.h> +#include <linux/gpio/consumer.h>
#include <sound/core.h> #include <sound/pcm.h> @@ -103,6 +104,7 @@ struct sun4i_codec { struct regmap *regmap; struct clk *clk_apb; struct clk *clk_module;
struct gpio_desc *gpio_pa;
struct snd_dmaengine_dai_dma_data capture_dma_data; struct snd_dmaengine_dai_dma_data playback_dma_data;
@@ -709,6 +711,26 @@ static struct snd_soc_dai_link *sun4i_codec_create_link(struct device *dev, return link; };
+static int sun4i_codec_spk_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *k, int event)
+{
- struct sun4i_codec *scodec = snd_soc_card_get_drvdata(w->dapm->card);
- if (scodec->gpio_pa)
gpiod_set_value_cansleep(scodec->gpio_pa,
!!SND_SOC_DAPM_EVENT_ON(event));
- return 0;
+}
+static const struct snd_soc_dapm_widget sun4i_codec_card_dapm_widgets[] = {
- SND_SOC_DAPM_SPK("Speaker", sun4i_codec_spk_event),
+};
+static const struct snd_soc_dapm_route sun4i_codec_card_dapm_routes[] = {
- { "Speaker", NULL, "Power Amplifier" },
+};
Shouldn't it be tied to the HP outputs instead?
Thanks! Maxime
Hi,
On 14-12-15 16:56, Maxime Ripard wrote:
Hi,
On Fri, Dec 11, 2015 at 07:43:57PM +0100, Hans de Goede wrote:
Add support for PA gpio pin for controlling an external amplifier as used on some Allwinner boards.
Signed-off-by: Hans de Goede hdegoede@redhat.com
Changes in v2: -Use a dapm speaker widget (SND_SOC_DAPM_SPK) to control the gpio
-Rename gpio in devicetree from pa-gpios to allwinner,pa-gpios
.../devicetree/bindings/sound/sun4i-codec.txt | 3 ++ sound/soc/sunxi/sun4i-codec.c | 35 ++++++++++++++++++++++ 2 files changed, 38 insertions(+)
diff --git a/Documentation/devicetree/bindings/sound/sun4i-codec.txt b/Documentation/devicetree/bindings/sound/sun4i-codec.txt index c92966b..0dce690 100644 --- a/Documentation/devicetree/bindings/sound/sun4i-codec.txt +++ b/Documentation/devicetree/bindings/sound/sun4i-codec.txt @@ -14,6 +14,9 @@ Required properties: - "apb": the parent APB clock for this controller - "codec": the parent module clock
+Optional properties: +- allwinner,pa-gpios: gpio to enable external amplifier
- Example: codec: codec@01c22c00 { #sound-dai-cells = <0>;
diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c index 519ccb3..e6cc6a1 100644 --- a/sound/soc/sunxi/sun4i-codec.c +++ b/sound/soc/sunxi/sun4i-codec.c @@ -28,6 +28,7 @@ #include <linux/of_address.h> #include <linux/clk.h> #include <linux/regmap.h> +#include <linux/gpio/consumer.h>
#include <sound/core.h> #include <sound/pcm.h> @@ -103,6 +104,7 @@ struct sun4i_codec { struct regmap *regmap; struct clk *clk_apb; struct clk *clk_module;
struct gpio_desc *gpio_pa;
struct snd_dmaengine_dai_dma_data capture_dma_data; struct snd_dmaengine_dai_dma_data playback_dma_data;
@@ -709,6 +711,26 @@ static struct snd_soc_dai_link *sun4i_codec_create_link(struct device *dev, return link; };
+static int sun4i_codec_spk_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *k, int event)
+{
- struct sun4i_codec *scodec = snd_soc_card_get_drvdata(w->dapm->card);
- if (scodec->gpio_pa)
gpiod_set_value_cansleep(scodec->gpio_pa,
!!SND_SOC_DAPM_EVENT_ON(event));
- return 0;
+}
+static const struct snd_soc_dapm_widget sun4i_codec_card_dapm_widgets[] = {
- SND_SOC_DAPM_SPK("Speaker", sun4i_codec_spk_event),
+};
+static const struct snd_soc_dapm_route sun4i_codec_card_dapm_routes[] = {
- { "Speaker", NULL, "Power Amplifier" },
+};
Shouldn't it be tied to the HP outputs instead?
You're right, the HP outputs are the final outputs, and since this is for enabling an external amplifier you're right. Since Mark has already merged this patch I will do a follow up patch to fix this.
Regards,
Hans
On Mon, Dec 14, 2015 at 05:07:47PM +0100, Hans de Goede wrote:
+static int sun4i_codec_spk_event(struct snd_soc_dapm_widget *w,
struct snd_kcontrol *k, int event)
+{
- struct sun4i_codec *scodec = snd_soc_card_get_drvdata(w->dapm->card);
- if (scodec->gpio_pa)
gpiod_set_value_cansleep(scodec->gpio_pa,
!!SND_SOC_DAPM_EVENT_ON(event));
- return 0;
+}
+static const struct snd_soc_dapm_widget sun4i_codec_card_dapm_widgets[] = {
- SND_SOC_DAPM_SPK("Speaker", sun4i_codec_spk_event),
+};
+static const struct snd_soc_dapm_route sun4i_codec_card_dapm_routes[] = {
- { "Speaker", NULL, "Power Amplifier" },
+};
Shouldn't it be tied to the HP outputs instead?
You're right, the HP outputs are the final outputs, and since this is for enabling an external amplifier you're right. Since Mark has already merged this patch I will do a follow up patch to fix this.
Great, thanks!
Maxime
The UTOO P66 tablet uses the A13's integrated audio codec, enable it.
Signed-off-by: Hans de Goede hdegoede@redhat.com --- Changes in v2: -Adjust for gpio rename from pa-gpios to allwinner,pa-gpios --- arch/arm/boot/dts/sun5i-a13-utoo-p66.dts | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
diff --git a/arch/arm/boot/dts/sun5i-a13-utoo-p66.dts b/arch/arm/boot/dts/sun5i-a13-utoo-p66.dts index 5236c1e..fa9ddfd 100644 --- a/arch/arm/boot/dts/sun5i-a13-utoo-p66.dts +++ b/arch/arm/boot/dts/sun5i-a13-utoo-p66.dts @@ -73,6 +73,13 @@ }; };
+&codec { + pinctrl-names = "default"; + pinctrl-0 = <&codec_pa_pin>; + allwinner,pa-gpios = <&pio 6 3 GPIO_ACTIVE_HIGH>; /* PG3 */ + status = "okay"; +}; + &cpu0 { cpu-supply = <®_dcdc2>; }; @@ -168,6 +175,13 @@ };
&pio { + codec_pa_pin: codec_pa_pin@0 { + allwinner,pins = "PG3"; + allwinner,function = "gpio_out"; + allwinner,drive = <SUN4I_PINCTRL_10_MA>; + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; + }; + mmc0_cd_pin_p66: mmc0_cd_pin@0 { allwinner,pins = "PG0"; allwinner,function = "gpio_in";
The pov protab2-ips9 tablet uses the A10's integrated audio codec, enable it.
Signed-off-by: Hans de Goede hdegoede@redhat.com --- Changes in v2: -Adjust for gpio rename from pa-gpios to allwinner,pa-gpios --- arch/arm/boot/dts/sun4i-a10-pov-protab2-ips9.dts | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
diff --git a/arch/arm/boot/dts/sun4i-a10-pov-protab2-ips9.dts b/arch/arm/boot/dts/sun4i-a10-pov-protab2-ips9.dts index a88d5f4..ea90634 100644 --- a/arch/arm/boot/dts/sun4i-a10-pov-protab2-ips9.dts +++ b/arch/arm/boot/dts/sun4i-a10-pov-protab2-ips9.dts @@ -72,6 +72,13 @@ }; };
+&codec { + pinctrl-names = "default"; + pinctrl-0 = <&codec_pa_pin>; + allwinner,pa-gpios = <&pio 7 15 GPIO_ACTIVE_HIGH>; /* PH15 */ + status = "okay"; +}; + &cpu0 { cpu-supply = <®_dcdc2>; }; @@ -170,6 +177,13 @@ allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; };
+ codec_pa_pin: codec_pa_pin@0 { + allwinner,pins = "PH15"; + allwinner,function = "gpio_out"; + allwinner,drive = <SUN4I_PINCTRL_10_MA>; + allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; + }; + touchscreen_pins: touchscreen_pins@0 { allwinner,pins = "PA5", "PB13"; allwinner,function = "gpio_out";
On Fri, Dec 11, 2015 at 07:43:59PM +0100, Hans de Goede wrote:
The pov protab2-ips9 tablet uses the A10's integrated audio codec, enable it.
Signed-off-by: Hans de Goede hdegoede@redhat.com
Applied 3 and 4. Thanks!
I have a bad network connection for the next two weeks though, so I'm not quite sure whether or not it will make it for 4.5.
Maxime
The patch
ASoC: sun4i-codec: Rename codec dapm widgets and routes
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks, Mark
From e6415b485059af183873e907662a3cdeefacb58b Mon Sep 17 00:00:00 2001
From: Hans de Goede hdegoede@redhat.com Date: Fri, 11 Dec 2015 19:43:56 +0100 Subject: [PATCH] ASoC: sun4i-codec: Rename codec dapm widgets and routes
Rename the codec dapm widgets and routes with a _codec prefix. This is a preparation patch for adding card dapm widgets and routes.
Signed-off-by: Hans de Goede hdegoede@redhat.com Signed-off-by: Mark Brown broonie@kernel.org --- sound/soc/sunxi/sun4i-codec.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c index 7a3fe1d..519ccb3 100644 --- a/sound/soc/sunxi/sun4i-codec.c +++ b/sound/soc/sunxi/sun4i-codec.c @@ -532,7 +532,7 @@ static const struct snd_kcontrol_new sun4i_codec_pa_mixer_controls[] = { SUN4I_CODEC_DAC_ACTL_MIXPAS, 1, 0), };
-static const struct snd_soc_dapm_widget sun4i_codec_dapm_widgets[] = { +static const struct snd_soc_dapm_widget sun4i_codec_codec_dapm_widgets[] = { /* Digital parts of the ADCs */ SND_SOC_DAPM_SUPPLY("ADC", SUN4I_CODEC_ADC_FIFOC, SUN4I_CODEC_ADC_FIFOC_EN_AD, 0, @@ -589,7 +589,7 @@ static const struct snd_soc_dapm_widget sun4i_codec_dapm_widgets[] = { SND_SOC_DAPM_OUTPUT("HP Left"), };
-static const struct snd_soc_dapm_route sun4i_codec_dapm_routes[] = { +static const struct snd_soc_dapm_route sun4i_codec_codec_dapm_routes[] = { /* Left ADC / DAC Routes */ { "Left ADC", NULL, "ADC" }, { "Left DAC", NULL, "DAC" }, @@ -628,10 +628,10 @@ static const struct snd_soc_dapm_route sun4i_codec_dapm_routes[] = { static struct snd_soc_codec_driver sun4i_codec_codec = { .controls = sun4i_codec_widgets, .num_controls = ARRAY_SIZE(sun4i_codec_widgets), - .dapm_widgets = sun4i_codec_dapm_widgets, - .num_dapm_widgets = ARRAY_SIZE(sun4i_codec_dapm_widgets), - .dapm_routes = sun4i_codec_dapm_routes, - .num_dapm_routes = ARRAY_SIZE(sun4i_codec_dapm_routes), + .dapm_widgets = sun4i_codec_codec_dapm_widgets, + .num_dapm_widgets = ARRAY_SIZE(sun4i_codec_codec_dapm_widgets), + .dapm_routes = sun4i_codec_codec_dapm_routes, + .num_dapm_routes = ARRAY_SIZE(sun4i_codec_codec_dapm_routes), };
static const struct snd_soc_component_driver sun4i_codec_component = {
Hi,
On Fri, Dec 11, 2015 at 07:43:56PM +0100, Hans de Goede wrote:
Rename the codec dapm widgets and routes with a _codec prefix. This is a preparation patch for adding card dapm widgets and routes.
Signed-off-by: Hans de Goede hdegoede@redhat.com
Acked-by: Maxime Ripard maxime.ripard@free-electrons.com
Thanks! Maxime
participants (4)
-
Hans de Goede
-
Mark Brown
-
Maxime Ripard
-
Rob Herring