Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/arch/arm/boot/dts/omap2420-n810.dts b/arch/arm/boot/dts/omap2420-n810.dts
- index 7c485fbfa535..4f44c6271cc0 100644
- --- a/arch/arm/boot/dts/omap2420-n810.dts
- +++ b/arch/arm/boot/dts/omap2420-n810.dts
- @@ -6,11 +6,57 @@
- / {
- model = "Nokia N810";
- compatible = "nokia,n810", "nokia,n8x0", "ti,omap2420", "ti,omap2";
- +
- + sound: n810-audio {
- + compatible = "nokia,n810-audio";
- +
- + nokia,cpu-dai = <&mcbsp2>;
- + nokia,audio-codec = <&aic3x>;
- +
- + headset-amplifier-gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>; /* gpio10 */
- + speaker-amplifier-gpios = <&gpio4 5 GPIO_ACTIVE_HIGH>; /* gpio101 */
- + };
- +};
- +
- +&omap2420_pmx {
- + mcbsp2_pins: mcbsp2_pins {
- + pinctrl-single,pins = <
- + OMAP2420_CORE_IOPAD(0x0124, PIN_INPUT | MUX_MODE1) /* eac_ac_sclk.mcbsp2_clkx */
- + OMAP2420_CORE_IOPAD(0x0125, PIN_INPUT | MUX_MODE1) /* eac_ac_fs.mcbsp2_fsx */
- + OMAP2420_CORE_IOPAD(0x0126, PIN_INPUT | MUX_MODE1) /* eac_ac_din.mcbsp2_dr */
- + OMAP2420_CORE_IOPAD(0x0127, PIN_OUTPUT | MUX_MODE1) /* eac_ac_dout.mcbsp2_dx */
- + >;
- + };
- +
- + aic3x_pins: aic3x_pins {
- + pinctrl-single,pins = <
- + OMAP2420_CORE_IOPAD(0x0129, PIN_OUTPUT | MUX_MODE3) /* eac_ac_rst.gpio118 */
- + >;
- + };
- };
- &i2c2 {
- - aic3x@18 {
- - compatible = "tlv320aic3x";
- + aic3x: aic3x@18 {
- + compatible = "ti,tlv320aic3x";
- reg = <0x18>;
- +
- + pinctrl-names = "default";
- + pinctrl-0 = <&aic3x_pins>;
- +
- + gpio-reset = <&gpio4 22 GPIO_ACTIVE_LOW>; /* gpio118 */
- + clocks = <&sys_clkout2>;
- + clock-names = "mclk";
- +
- + assigned-clocks = <&sys_clkout2_src>, <&sys_clkout2>;
- + assigned-clock-parents = <&func_96m_ck>;
- + assigned-clock-rates = <0>, <12000000>;
- +
- };
- };
- +
- +&mcbsp2 {
- + pinctrl-names = "default";
- + pinctrl-0 = <&mcbsp2_pins>;
- +
- + status = "okay";
- +};
- diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c
- index 538da20bb480..1efbad8d4fe3 100644
- --- a/sound/soc/codecs/tlv320aic3x.c
- +++ b/sound/soc/codecs/tlv320aic3x.c
- @@ -40,6 +40,7 @@
- #include <linux/i2c.h>
- #include <linux/gpio.h>
- #include <linux/regulator/consumer.h>
- +#include <linux/clk.h>
- #include <linux/of.h>
- #include <linux/of_gpio.h>
- #include <linux/slab.h>
- @@ -75,6 +76,7 @@ struct aic3x_priv {
- struct snd_soc_component *component;
- struct regmap *regmap;
- struct regulator_bulk_data supplies[AIC3X_NUM_SUPPLIES];
- + struct clk *mclk;
- struct aic3x_disable_nb disable_nb[AIC3X_NUM_SUPPLIES];
- struct aic3x_setup_data *setup;
- unsigned int sysclk;
- @@ -1379,10 +1381,17 @@ static int aic3x_set_power(struct snd_soc_component *component, int power)
- int ret;
- if (power) {
- + ret = clk_prepare_enable(aic3x->mclk);
- + if (ret)
- + goto out;
- +
- ret = regulator_bulk_enable(ARRAY_SIZE(aic3x->supplies),
- aic3x->supplies);
- - if (ret)
- + if (ret) {
- + clk_disable_unprepare(aic3x->mclk);
- goto out;
- + }
- +
- aic3x->power = 1;
- if (gpio_is_valid(aic3x->gpio_reset)) {
- @@ -1864,6 +1873,17 @@ static int aic3x_i2c_probe(struct i2c_client *i2c,
- gpio_direction_output(aic3x->gpio_reset, 0);
- }
- + aic3x->mclk = devm_clk_get(&i2c->dev, "mclk");
- + if (IS_ERR(aic3x->mclk)) {
- + /*The mclk clock is optional */
- + if (PTR_ERR(aic3x->mclk) != -ENOENT) {
- + ret = PTR_ERR(aic3x->mclk);
- + goto err_gpio;
- + }
- +
- + aic3x->mclk = NULL;
- + }
- +
- for (i = 0; i < ARRAY_SIZE(aic3x->supplies); i++)
- aic3x->supplies[i].supply = aic3x_supply_names[i];
- diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig
- index da81f730697c..03f4f4f8a17e 100644
- --- a/sound/soc/omap/Kconfig
- +++ b/sound/soc/omap/Kconfig
- @@ -47,7 +47,6 @@ config SND_OMAP_SOC_HDMI_AUDIO
- config SND_OMAP_SOC_N810
- tristate "SoC Audio support for Nokia N810"
- depends on SND_SDMA_SOC && MACH_NOKIA_N810 && I2C
- - depends on OMAP_MUX
- select SND_OMAP_SOC_MCBSP
- select SND_SOC_TLV320AIC3X
- help
- diff --git a/sound/soc/omap/n810.c b/sound/soc/omap/n810.c
- index 71e5f31fa306..fb8b3db988b8 100644
- --- a/sound/soc/omap/n810.c
- +++ b/sound/soc/omap/n810.c
- @@ -38,6 +38,11 @@
- #define N810_HEADSET_AMP_GPIO 10
- #define N810_SPEAKER_AMP_GPIO 101
- +struct n810_audio_data {
- + struct gpio_desc *headset_amp_gpio;
- + struct gpio_desc *speaker_amp_gpio;
- +};
- +
- enum {
- N810_JACK_DISABLED,
- N810_JACK_HP,
- @@ -257,9 +262,9 @@ static const struct snd_kcontrol_new aic33_n810_controls[] = {
- static struct snd_soc_dai_link n810_dai = {
- .name = "TLV320AIC33",
- .stream_name = "AIC33",
- - .cpu_dai_name = "omap-mcbsp.2",
- - .platform_name = "omap-mcbsp.2",
- - .codec_name = "tlv320aic3x-codec.2-0018",
- + .cpu_dai_name = "48076000.mcbsp",
- + .platform_name = "48076000.mcbsp",
- + .codec_name = "tlv320aic3x-codec.1-0018",
- .codec_dai_name = "tlv320aic3x-hifi",
- .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
- SND_SOC_DAIFMT_CBM_CFM,
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement