Beaglebone-Black HDMI audio
Subsystems (9)
cover Beaglebone-Black HDMI audio
The code has a functional dependency to:
http://www.mail-archive.com/[email protected]/msg108199.html
Without the above patch the audio card does not probe.
The code has been rebased on top of Linux 3.16 merged withgit://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
with http://www.mail-archive.com/[email protected]/msg108199.html
cherry-picked on top.
All patches have gone trough some cleaning up since the RFC version of these patches over half a year ago.
Jyri Sarha (9):
ASoC: mcasp: Fix implicit BLCK divider setting
clk: add gpio controlled clock
drm/tilcdc: Add I2S HDMI audio config for tda998x
ASoC: davinci-evm: HDMI audio support for TDA998x trough McASP I2S
bus
ASoC: davinci: HDMI audio build for AM33XX and TDA998x
ARM: dts: am33xx: Add external clock provider
ARM: dts: am335x-boneblack: Add HDMI audio support
ARM: OMAP2+: omap2plus_defconfig: TDA998X HDMI trough tilcdc,slave
ARM: OMAP2+: omap2plus_defconfig: Enable BeagleBone Black HDMI audio
support
.../devicetree/bindings/clock/gpio-clock.txt | 21 ++ .../bindings/sound/davinci-evm-audio.txt | 4 +- arch/arm/boot/dts/am335x-boneblack.dts | 54 +++++ arch/arm/boot/dts/am33xx.dtsi | 10 + arch/arm/configs/omap2plus_defconfig | 5 + drivers/clk/Makefile | 1 + drivers/clk/clk-gpio.c | 206 ++++++++++++++++++++ drivers/gpu/drm/tilcdc/tilcdc_slave.c | 24 ++- include/linux/clk-provider.h | 23 +++ sound/soc/davinci/Kconfig | 12 ++ sound/soc/davinci/davinci-evm.c | 82 +++++++- sound/soc/davinci/davinci-mcasp.c | 14 +- 12 files changed, 449 insertions(+), 7 deletions(-) create mode 100644 Documentation/devicetree/bindings/clock/gpio-clock.txt create mode 100644 drivers/clk/clk-gpio.c
Signature · 6 lines
1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 1/9 ASoC: mcasp: Fix implicit BLCK divider setting
The implicit BLCK divider setting was broken by "ASoC: mcasp: don't override bclk divider if it was provided by the machine"-patch. After the BCLK divider is implicitly set for the first time the mcasp->bclk_div gets a non zero value and the implicit setting is "turned off".
--- sound/soc/davinci/davinci-mcasp.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
sound/soc/davinci/davinci-mcasp.c +11 -3
@@ -403,7 +403,8 @@ out:return ret; } -static int davinci_mcasp_set_clkdiv (struct snd_soc_dai *dai,int div_id,int div) +static int __davinci_mcasp_set_clkdiv (struct snd_soc_dai *dai,int div_id, +int div,bool explicit) {struct davinci_mcasp *mcasp =snd_soc_dai_get_drvdata (dai);
@@ -420,7 +421,8 @@ static int davinci_mcasp_set_clkdiv(struct snd_soc_dai *dai, int div_id, int div ACLKXDIV(div - 1), ACLKXDIV_MASK);mcasp_mod_bits (mcasp,DAVINCI_MCASP_ACLKRCTL_REG ,ACLKRDIV (div -1 ),ACLKRDIV_MASK ); - mcasp->bclk_div = div; +if (explicit) + mcasp->bclk_div = div;break ;case 2 :/* BCLK/LRCLK ratio */
@@ -434,6 +436,12 @@ static int davinci_mcasp_set_clkdiv(struct snd_soc_dai *dai, int div_id, int divreturn 0 ; } +static int davinci_mcasp_set_clkdiv (struct snd_soc_dai *dai,int div_id, +int div) +{ +return __davinci_mcasp_set_clkdiv (dai, div_id, div,1 ); +} +static int davinci_mcasp_set_sysclk (struct snd_soc_dai *dai,int clk_id,unsigned int freq,int dir) {
@@ -738,7 +746,7 @@ static int davinci_mcasp_hw_params(struct snd_pcm_substream *substream,"Inaccurate BCLK: %u Hz / %u != %u Hz\n" , mcasp->sysclk_freq, div, bclk_freq); } -davinci_mcasp_set_clkdiv (cpu_dai,1 , div); +__davinci_mcasp_set_clkdiv (cpu_dai,1 , div,0 ); } ret = mcasp_common_hw_param(mcasp, substream->stream,
Signature · 1 line
1.7.9.5
PATCH 2/9 clk: add gpio controlled clock
In reply to Jyri SarhaThe added clk-gpio is a basic clock that can be enabled and disabled trough a gpio output. The DT binding document for the clock is also added. For EPROBE_DEFER handling the registering of the clock has to be delayed until of_clk_get() call time.
--- .../devicetree/bindings/clock/gpio-clock.txt | 21 ++ drivers/clk/Makefile | 1 + drivers/clk/clk-gpio.c | 206 ++++++++++++++++++++ include/linux/clk-provider.h | 23 +++ 4 files changed, 251 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/gpio-clock.txt create mode 100644 drivers/clk/clk-gpio.c
Documentation/devicetree/bindings/clock/gpio-clock.txt new file +21 -0
@@ -0,0 +1,21 @@ +Binding for simple gpio controlled clock. + +This binding uses the common clock binding[1]. + +[1] Documentation/devicetree/bindings/clock/clock-bindings.txt + +Required properties: +- compatible : shall be "gpio-clock". +- #clock-cells : from common clock binding; shall be set to 0. +- enable-gpios : GPIO reference for enabling and disabling the clock. + +Optional properties: +- clocks: Maximum of one parent clock is supported. + +Example: + clock { + compatible = "gpio-clock"; + clocks = <&parentclk>; + #clock-cells = <0>; + enable-gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; + };
drivers/clk/Makefile +1 -0
@@ -9,6 +9,7 @@ obj-$(CONFIG_COMMON_CLK) += clk-gate.o obj-$(CONFIG_COMMON_CLK) += clk-mux.o obj-$(CONFIG_COMMON_CLK) += clk-composite.o obj-$(CONFIG_COMMON_CLK) += clk-fractional-divider.o +obj-$(CONFIG_COMMON_CLK) += clk-gpio.o # hardware specific clock types # please keep this section sorted lexicographically by file/directory path name
drivers/clk/clk-gpio.c new file +206 -0
206 lines not on this page · raw message
include/linux/clk-provider.h +23 -0
@@ -488,6 +488,29 @@ struct clk *clk_register_composite(struct device *dev, const char *name, struct clk_hw *gate_hw, const struct clk_ops *gate_ops, unsigned long flags); +/*** +* struct clk_gpio - gpio controlled clock +* +* @hw: handle between common and hardware-specific interfaces +* @gpio: gpio +* @active_low: gpio polarity +* +* Clock with a gpio control for enabling and disabling the parent clock. +* Implements .enable, .disable and .is_enabled +*/ + +struct clk_gpio { +struct clk_hw hw; +struct gpio_desc *gpiod; +}; + +extern const struct clk_ops clk_gpio_ops; +struct clk *clk_register_gpio (struct device *dev,const char *name, +const char *parent_name,struct gpio_desc *gpio, +unsigned long flags); + +void of_gpio_clk_setup (struct device_node *node); +/** * clk_register - allocate a new clock, register it and return an opaque cookie * @dev: device that is registering this clock
Signature · 1 line
1.7.9.5
PATCH 3/9 drm/tilcdc: Add I2S HDMI audio config for tda998x
In reply to Jyri SarhaThe configuration is needed for HDMI audio. The "swap" and "mirr" parameters have to be correctly set in the configuration in order to have proper colors in the HDMI picture.
--- drivers/gpu/drm/tilcdc/tilcdc_slave.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-)
drivers/gpu/drm/tilcdc/tilcdc_slave.c +23 -1
@@ -19,6 +19,7 @@#include <linux/pinctrl/pinmux.h> #include <linux/pinctrl/consumer.h> #include <drm/drm_encoder_slave.h> +#include <drm/i2c/tda998x.h> #include "tilcdc_drv.h"
@@ -111,8 +112,29 @@ static const struct drm_encoder_helper_funcs slave_encoder_helper_funcs = { .restore = drm_i2c_encoder_restore, }; +static struct tda998x_encoder_params tda998x_pdata = { + .swap_b =0x3 , + .mirr_b =0x0 , + .swap_a =0x2 , + .mirr_a =0x0 , + .swap_d =0x1 , + .mirr_d =0x0 , + .swap_c =0x0 , + .mirr_c =0x0 , + .swap_f =0x5 , + .mirr_f =0x0 , + .swap_e =0x4 , + .mirr_e =0x0 , + .audio_cfg =0x3 ,/* I2S mode */ + .audio_clk_cfg =1 ,/* select clock pin */ + .audio_frame[1 ] =1 ,/* channels - 1 */ + .audio_format =AFMT_I2S , + .audio_sample_rate =48000 , +}; +static const struct i2c_board_info info = { -I2C_BOARD_INFO ("tda998x" ,0x70 ) +I2C_BOARD_INFO ("tda998x" ,0x70 ), + .platform_data = &tda998x_pdata, }; static struct drm_encoder *slave_encoder_create(struct drm_device *dev,
Signature · 1 line
1.7.9.5
PATCH 4/9 ASoC: davinci-evm: HDMI audio support for TDA998x trough McASP I2S bus
In reply to Jyri SarhaAdd machine driver support for BeagleBone-Black HDMI audio. BBB has NXP TDA998X HDMI transmitter connected to McASP port in I2S mode. The 44100 Hz sample-rate and it's multiples can not be accurately produced on BBB. The only supported sample format is SNDRV_PCM_FORMAT_S32_LE. The 8 least significant bits are ignored.
--- .../bindings/sound/davinci-evm-audio.txt | 4 +- sound/soc/davinci/davinci-evm.c | 82 +++++++++++++++++++- 2 files changed, 83 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/sound/davinci-evm-audio.txt +3 -1
@@ -1,7 +1,9 @@ * Texas Instruments SoC audio setups with TLV320AIC3X Codec Required properties: -- compatible : "ti,da830-evm-audio" : forDM365/DA8xx/OMAPL1x/AM33xx +- compatible : "ti,da830-evm-audio" : for DM365/DA8xx/OMAPL1x/AM33xx + "ti,am335x-beaglebone-black-audio" : for Beaglebone-black HDMI + audio - ti,model : The user-visible name of this sound complex. - ti,audio-codec : The phandle of the TLV320AIC3x audio codec - ti,mcasp-controller : The phandle of the McASP controller
sound/soc/davinci/davinci-evm.c +80 -2
121 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH 5/9 ASoC: davinci: HDMI audio build for AM33XX and TDA998x
In reply to Jyri SarhaAdds configuration option for HDMI audio support for AM33XX based boards with NXP TDA998x HDMI transmitter. The audio is connected to NXP TDA998x trough McASP running in i2s mode.
--- sound/soc/davinci/Kconfig | 12 ++++++++++++ 1 file changed, 12 insertions(+)
sound/soc/davinci/Kconfig +12 -0
@@ -37,6 +37,18 @@ config SND_AM33XX_SOC_EVM AM335X-EVMSK, and BeagelBone with AudioCape boards have this setup. +config SND_AM335X_SOC_NXPTDA_EVM + tristate "HDMI Audio for the AM33XX chip based boards with TDA998x" + depends on SND_EDMA_SOC && SOC_AM33XX && DRM_I2C_NXP_TDA998X + select SND_SOC_HDMI_CODEC + select SND_DAVINCI_SOC_MCASP + select SND_DAVINCI_SOC_GENERIC_EVM + help + Say Y or M if you want to add support for HDMI SoC audio on + AM33XX boards with NXP TDA998x HDMI transmitter. For example + BeagleBoneBack. The audio is connected to NXP TDA998x trough + McASP running in i2s mode. + config SND_DAVINCI_SOC_EVM tristate "SoC Audio support for DaVinci DM6446, DM355 or DM365 EVM" depends on SND_DAVINCI_SOC && I2C
Signature · 1 line
1.7.9.5
PATCH 6/9 ARM: dts: am33xx: Add external clock provider
In reply to Jyri SarhaAdd external clock provaider for am33xx devices.
--- arch/arm/boot/dts/am33xx.dtsi | 10 ++++++++++ 1 file changed, 10 insertions(+)
arch/arm/boot/dts/am33xx.dtsi +10 -0
@@ -92,6 +92,16 @@ pinctrl-single,function-mask = <0x7f>; }; + ext_clocks { + compatible = "ti,external-clocks"; + + ext_clocks: clocks { + }; + + ext_clockdomains: clockdomains { + }; + }; + /* * XXX: Use a flat representation of the AM33XX interconnect. * The real AM33XX interconnect network is quite complex. Since
Signature · 1 line
1.7.9.5
PATCH 7/9 ARM: dts: am335x-boneblack: Add HDMI audio support
In reply to Jyri SarhaAdds mcasp0_pins, clk_mcasp0_fixed, clk_mcasp0, mcasp0, hdmi_audio, and sound nodes.
--- arch/arm/boot/dts/am335x-boneblack.dts | 54 ++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+)
arch/arm/boot/dts/am335x-boneblack.dts +54 -0
@@ -59,12 +59,50 @@ 0x1b0 0x03 /* xdma_event_intr0, OMAP_MUX_MODE3 | AM33XX_PIN_OUTPUT */ >; }; + + mcasp0_pins: mcasp0_pins { + pinctrl-single,pins = < + 0x1ac (PIN_INPUT_PULLUP | MUX_MODE0) /* mcasp0_ahclkx.mcasp0_ahclkx */ + 0x19c (PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mcasp0_ahclkr.mcasp0_axr2 */ + 0x194 (PIN_OUTPUT_PULLUP | MUX_MODE0) /* mcasp0_fsx.mcasp0_fsx */ + 0x190 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mcasp0_aclkx.mcasp0_aclkx */ + 0x06c (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a11.GPIO1_27 */ + >; + }; }; &lcdc { status = "okay"; }; +&mcasp0 { + pinctrl-names = "default"; + pinctrl-0 = <&mcasp0_pins>; + status = "okay"; + op-mode = <0>; /* MCASP_IIS_MODE */ + tdm-slots = <2>; + serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */ + 0 0 1 0 + >; + tx-num-evt = <1>; + rx-num-evt = <1>; +}; + +&ext_clocks { + clk_mcasp0_fixed: clk_mcasp0_fixed { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <24576000>; + }; + + clk_mcasp0: clk_mcasp0 { + #clock-cells = <0>; + compatible = "gpio-clock"; + clocks = <&clk_mcasp0_fixed>; + enable-gpios = <&gpio1 27 0>; /* BeagleBone Black Clk enable on GPIO1_27 */ + }; +}; + / { hdmi { compatible = "ti,tilcdc,slave";
@@ -74,4 +112,20 @@ pinctrl-1 = <&nxp_hdmi_bonelt_off_pins>; status = "okay"; }; + + hdmi_audio: hdmi_audio@0 { + compatible = "linux,hdmi-audio"; + status = "okay"; + }; + + sound { + compatible = "ti,am335x-beaglebone-black-audio"; + ti,model = "TI BeagleBone Black"; + ti,audio-codec = <&hdmi_audio>; + ti,mcasp-controller = <&mcasp0>; + ti,audio-routing = + "HDMI Out", "TX"; + clocks = <&clk_mcasp0>; + clock-names = "mclk"; + }; };
Signature · 1 line
1.7.9.5
PATCH 8/9 ARM: OMAP2+: omap2plus_defconfig: TDA998X HDMI trough tilcdc,slave
In reply to Jyri SarhaSelect CONFIG_DRM=m, CONFIG_DRM_I2C_NXP_TDA998X=m, and CONFIG_DRM_TILCDC=m, for Beaglebone-Black HDMI video support.
--- arch/arm/configs/omap2plus_defconfig | 3 +++ 1 file changed, 3 insertions(+)
arch/arm/configs/omap2plus_defconfig +3 -0
@@ -191,6 +191,9 @@ CONFIG_REGULATOR_TPS65217=y CONFIG_REGULATOR_TPS65910=y CONFIG_REGULATOR_TWL4030=y CONFIG_REGULATOR_PBIAS=y +CONFIG_DRM=m +CONFIG_DRM_I2C_NXP_TDA998X=m +CONFIG_DRM_TILCDC=m CONFIG_FB=y CONFIG_FIRMWARE_EDID=y CONFIG_FB_MODE_HELPERS=y
Signature · 1 line
1.7.9.5
PATCH 9/9 ARM: OMAP2+: omap2plus_defconfig: Enable BeagleBone Black HDMI audio support
In reply to Jyri SarhaSelect CONFIG_SND_EDMA_SOC=m and CONFIG_SND_AM335X_SOC_NXPTDA_EVM=m for BBB HDMI audio.
--- arch/arm/configs/omap2plus_defconfig | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/configs/omap2plus_defconfig +2 -0
@@ -222,7 +222,9 @@ CONFIG_SND_DEBUG=y CONFIG_SND_USB_AUDIO=m CONFIG_SND_SOC=m CONFIG_SND_OMAP_SOC=m +CONFIG_SND_EDMA_SOC=m CONFIG_SND_AM33XX_SOC_EVM=m +CONFIG_SND_AM335X_SOC_NXPTDA_EVM=m CONFIG_SND_DAVINCI_SOC=m CONFIG_SND_OMAP_SOC_OMAP_TWL4030=m CONFIG_SND_OMAP_SOC_OMAP_ABE_TWL6040=m
Signature · 1 line
1.7.9.5
PATCH 1/9 ASoC: mcasp: Fix implicit BLCK divider setting
In reply to Jyri SarhaThe implicit BLCK divider setting was broken by "ASoC: mcasp: don't override bclk divider if it was provided by the machine"-patch. After the BCLK divider is implicitly set for the first time the mcasp->bclk_div gets a non zero value and the implicit setting is "turned off".
--- sound/soc/davinci/davinci-mcasp.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
sound/soc/davinci/davinci-mcasp.c +11 -3
@@ -403,7 +403,8 @@ out:return ret; } -static int davinci_mcasp_set_clkdiv (struct snd_soc_dai *dai,int div_id,int div) +static int __davinci_mcasp_set_clkdiv (struct snd_soc_dai *dai,int div_id, +int div,bool explicit) {struct davinci_mcasp *mcasp =snd_soc_dai_get_drvdata (dai);
@@ -420,7 +421,8 @@ static int davinci_mcasp_set_clkdiv(struct snd_soc_dai *dai, int div_id, int div ACLKXDIV(div - 1), ACLKXDIV_MASK);mcasp_mod_bits (mcasp,DAVINCI_MCASP_ACLKRCTL_REG ,ACLKRDIV (div -1 ),ACLKRDIV_MASK ); - mcasp->bclk_div = div; +if (explicit) + mcasp->bclk_div = div;break ;case 2 :/* BCLK/LRCLK ratio */
@@ -434,6 +436,12 @@ static int davinci_mcasp_set_clkdiv(struct snd_soc_dai *dai, int div_id, int divreturn 0 ; } +static int davinci_mcasp_set_clkdiv (struct snd_soc_dai *dai,int div_id, +int div) +{ +return __davinci_mcasp_set_clkdiv (dai, div_id, div,1 ); +} +static int davinci_mcasp_set_sysclk (struct snd_soc_dai *dai,int clk_id,unsigned int freq,int dir) {
@@ -738,7 +746,7 @@ static int davinci_mcasp_hw_params(struct snd_pcm_substream *substream,"Inaccurate BCLK: %u Hz / %u != %u Hz\n" , mcasp->sysclk_freq, div, bclk_freq); } -davinci_mcasp_set_clkdiv (cpu_dai,1 , div); +__davinci_mcasp_set_clkdiv (cpu_dai,1 , div,0 ); } ret = mcasp_common_hw_param(mcasp, substream->stream,
Signature · 1 line
1.7.9.5
PATCH 2/9 clk: add gpio controlled clock
In reply to Jyri SarhaThe added clk-gpio is a basic clock that can be enabled and disabled trough a gpio output. The DT binding document for the clock is also added. For EPROBE_DEFER handling the registering of the clock has to be delayed until of_clk_get() call time.
--- .../devicetree/bindings/clock/gpio-clock.txt | 21 ++ drivers/clk/Makefile | 1 + drivers/clk/clk-gpio.c | 206 ++++++++++++++++++++ include/linux/clk-provider.h | 23 +++ 4 files changed, 251 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/gpio-clock.txt create mode 100644 drivers/clk/clk-gpio.c
Documentation/devicetree/bindings/clock/gpio-clock.txt new file +21 -0
@@ -0,0 +1,21 @@ +Binding for simple gpio controlled clock. + +This binding uses the common clock binding[1]. + +[1] Documentation/devicetree/bindings/clock/clock-bindings.txt + +Required properties: +- compatible : shall be "gpio-clock". +- #clock-cells : from common clock binding; shall be set to 0. +- enable-gpios : GPIO reference for enabling and disabling the clock. + +Optional properties: +- clocks: Maximum of one parent clock is supported. + +Example: + clock { + compatible = "gpio-clock"; + clocks = <&parentclk>; + #clock-cells = <0>; + enable-gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; + };
drivers/clk/Makefile +1 -0
@@ -9,6 +9,7 @@ obj-$(CONFIG_COMMON_CLK) += clk-gate.o obj-$(CONFIG_COMMON_CLK) += clk-mux.o obj-$(CONFIG_COMMON_CLK) += clk-composite.o obj-$(CONFIG_COMMON_CLK) += clk-fractional-divider.o +obj-$(CONFIG_COMMON_CLK) += clk-gpio.o # hardware specific clock types # please keep this section sorted lexicographically by file/directory path name
drivers/clk/clk-gpio.c new file +206 -0
206 lines not on this page · raw message
include/linux/clk-provider.h +23 -0
@@ -488,6 +488,29 @@ struct clk *clk_register_composite(struct device *dev, const char *name, struct clk_hw *gate_hw, const struct clk_ops *gate_ops, unsigned long flags); +/*** +* struct clk_gpio - gpio controlled clock +* +* @hw: handle between common and hardware-specific interfaces +* @gpio: gpio +* @active_low: gpio polarity +* +* Clock with a gpio control for enabling and disabling the parent clock. +* Implements .enable, .disable and .is_enabled +*/ + +struct clk_gpio { +struct clk_hw hw; +struct gpio_desc *gpiod; +}; + +extern const struct clk_ops clk_gpio_ops; +struct clk *clk_register_gpio (struct device *dev,const char *name, +const char *parent_name,struct gpio_desc *gpio, +unsigned long flags); + +void of_gpio_clk_setup (struct device_node *node); +/** * clk_register - allocate a new clock, register it and return an opaque cookie * @dev: device that is registering this clock
Signature · 1 line
1.7.9.5
PATCH 3/9 drm/tilcdc: Add I2S HDMI audio config for tda998x
In reply to Jyri SarhaThe configuration is needed for HDMI audio. The "swap" and "mirr" parameters have to be correctly set in the configuration in order to have proper colors in the HDMI picture.
--- drivers/gpu/drm/tilcdc/tilcdc_slave.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-)
drivers/gpu/drm/tilcdc/tilcdc_slave.c +23 -1
@@ -19,6 +19,7 @@#include <linux/pinctrl/pinmux.h> #include <linux/pinctrl/consumer.h> #include <drm/drm_encoder_slave.h> +#include <drm/i2c/tda998x.h> #include "tilcdc_drv.h"
@@ -111,8 +112,29 @@ static const struct drm_encoder_helper_funcs slave_encoder_helper_funcs = { .restore = drm_i2c_encoder_restore, }; +static struct tda998x_encoder_params tda998x_pdata = { + .swap_b =0x3 , + .mirr_b =0x0 , + .swap_a =0x2 , + .mirr_a =0x0 , + .swap_d =0x1 , + .mirr_d =0x0 , + .swap_c =0x0 , + .mirr_c =0x0 , + .swap_f =0x5 , + .mirr_f =0x0 , + .swap_e =0x4 , + .mirr_e =0x0 , + .audio_cfg =0x3 ,/* I2S mode */ + .audio_clk_cfg =1 ,/* select clock pin */ + .audio_frame[1 ] =1 ,/* channels - 1 */ + .audio_format =AFMT_I2S , + .audio_sample_rate =48000 , +}; +static const struct i2c_board_info info = { -I2C_BOARD_INFO ("tda998x" ,0x70 ) +I2C_BOARD_INFO ("tda998x" ,0x70 ), + .platform_data = &tda998x_pdata, }; static struct drm_encoder *slave_encoder_create(struct drm_device *dev,
Signature · 1 line
1.7.9.5
PATCH 4/9 ASoC: davinci-evm: HDMI audio support for TDA998x trough McASP I2S bus
In reply to Jyri SarhaAdd machine driver support for BeagleBone-Black HDMI audio. BBB has NXP TDA998X HDMI transmitter connected to McASP port in I2S mode. The 44100 Hz sample-rate and it's multiples can not be accurately produced on BBB. The only supported sample format is SNDRV_PCM_FORMAT_S32_LE. The 8 least significant bits are ignored.
--- .../bindings/sound/davinci-evm-audio.txt | 4 +- sound/soc/davinci/davinci-evm.c | 82 +++++++++++++++++++- 2 files changed, 83 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/sound/davinci-evm-audio.txt +3 -1
@@ -1,7 +1,9 @@ * Texas Instruments SoC audio setups with TLV320AIC3X Codec Required properties: -- compatible : "ti,da830-evm-audio" : forDM365/DA8xx/OMAPL1x/AM33xx +- compatible : "ti,da830-evm-audio" : for DM365/DA8xx/OMAPL1x/AM33xx + "ti,am335x-beaglebone-black-audio" : for Beaglebone-black HDMI + audio - ti,model : The user-visible name of this sound complex. - ti,audio-codec : The phandle of the TLV320AIC3x audio codec - ti,mcasp-controller : The phandle of the McASP controller
sound/soc/davinci/davinci-evm.c +80 -2
121 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH 5/9 ASoC: davinci: HDMI audio build for AM33XX and TDA998x
In reply to Jyri SarhaAdds configuration option for HDMI audio support for AM33XX based boards with NXP TDA998x HDMI transmitter. The audio is connected to NXP TDA998x trough McASP running in i2s mode.
--- sound/soc/davinci/Kconfig | 12 ++++++++++++ 1 file changed, 12 insertions(+)
sound/soc/davinci/Kconfig +12 -0
@@ -37,6 +37,18 @@ config SND_AM33XX_SOC_EVM AM335X-EVMSK, and BeagelBone with AudioCape boards have this setup. +config SND_AM335X_SOC_NXPTDA_EVM + tristate "HDMI Audio for the AM33XX chip based boards with TDA998x" + depends on SND_EDMA_SOC && SOC_AM33XX && DRM_I2C_NXP_TDA998X + select SND_SOC_HDMI_CODEC + select SND_DAVINCI_SOC_MCASP + select SND_DAVINCI_SOC_GENERIC_EVM + help + Say Y or M if you want to add support for HDMI SoC audio on + AM33XX boards with NXP TDA998x HDMI transmitter. For example + BeagleBoneBack. The audio is connected to NXP TDA998x trough + McASP running in i2s mode. + config SND_DAVINCI_SOC_EVM tristate "SoC Audio support for DaVinci DM6446, DM355 or DM365 EVM" depends on SND_DAVINCI_SOC && I2C
Signature · 1 line
1.7.9.5
PATCH 6/9 ARM: dts: am33xx: Add external clock provider
In reply to Jyri SarhaAdd external clock provaider for am33xx devices.
--- arch/arm/boot/dts/am33xx.dtsi | 10 ++++++++++ 1 file changed, 10 insertions(+)
arch/arm/boot/dts/am33xx.dtsi +10 -0
@@ -92,6 +92,16 @@ pinctrl-single,function-mask = <0x7f>; }; + ext_clocks { + compatible = "ti,external-clocks"; + + ext_clocks: clocks { + }; + + ext_clockdomains: clockdomains { + }; + }; + /* * XXX: Use a flat representation of the AM33XX interconnect. * The real AM33XX interconnect network is quite complex. Since
Signature · 1 line
1.7.9.5
PATCH 7/9 ARM: dts: am335x-boneblack: Add HDMI audio support
In reply to Jyri SarhaAdds mcasp0_pins, clk_mcasp0_fixed, clk_mcasp0, mcasp0, hdmi_audio, and sound nodes.
--- arch/arm/boot/dts/am335x-boneblack.dts | 54 ++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+)
arch/arm/boot/dts/am335x-boneblack.dts +54 -0
@@ -59,12 +59,50 @@ 0x1b0 0x03 /* xdma_event_intr0, OMAP_MUX_MODE3 | AM33XX_PIN_OUTPUT */ >; }; + + mcasp0_pins: mcasp0_pins { + pinctrl-single,pins = < + 0x1ac (PIN_INPUT_PULLUP | MUX_MODE0) /* mcasp0_ahclkx.mcasp0_ahclkx */ + 0x19c (PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mcasp0_ahclkr.mcasp0_axr2 */ + 0x194 (PIN_OUTPUT_PULLUP | MUX_MODE0) /* mcasp0_fsx.mcasp0_fsx */ + 0x190 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mcasp0_aclkx.mcasp0_aclkx */ + 0x06c (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a11.GPIO1_27 */ + >; + }; }; &lcdc { status = "okay"; }; +&mcasp0 { + pinctrl-names = "default"; + pinctrl-0 = <&mcasp0_pins>; + status = "okay"; + op-mode = <0>; /* MCASP_IIS_MODE */ + tdm-slots = <2>; + serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */ + 0 0 1 0 + >; + tx-num-evt = <1>; + rx-num-evt = <1>; +}; + +&ext_clocks { + clk_mcasp0_fixed: clk_mcasp0_fixed { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <24576000>; + }; + + clk_mcasp0: clk_mcasp0 { + #clock-cells = <0>; + compatible = "gpio-clock"; + clocks = <&clk_mcasp0_fixed>; + enable-gpios = <&gpio1 27 0>; /* BeagleBone Black Clk enable on GPIO1_27 */ + }; +}; + / { hdmi { compatible = "ti,tilcdc,slave";
@@ -74,4 +112,20 @@ pinctrl-1 = <&nxp_hdmi_bonelt_off_pins>; status = "okay"; }; + + hdmi_audio: hdmi_audio@0 { + compatible = "linux,hdmi-audio"; + status = "okay"; + }; + + sound { + compatible = "ti,am335x-beaglebone-black-audio"; + ti,model = "TI BeagleBone Black"; + ti,audio-codec = <&hdmi_audio>; + ti,mcasp-controller = <&mcasp0>; + ti,audio-routing = + "HDMI Out", "TX"; + clocks = <&clk_mcasp0>; + clock-names = "mclk"; + }; };
Signature · 1 line
1.7.9.5
PATCH 8/9 ARM: OMAP2+: omap2plus_defconfig: TDA998X HDMI trough tilcdc, slave
In reply to Jyri SarhaSelect CONFIG_DRM=m, CONFIG_DRM_I2C_NXP_TDA998X=m, and CONFIG_DRM_TILCDC=m, for Beaglebone-Black HDMI video support.
--- arch/arm/configs/omap2plus_defconfig | 3 +++ 1 file changed, 3 insertions(+)
arch/arm/configs/omap2plus_defconfig +3 -0
@@ -191,6 +191,9 @@ CONFIG_REGULATOR_TPS65217=y CONFIG_REGULATOR_TPS65910=y CONFIG_REGULATOR_TWL4030=y CONFIG_REGULATOR_PBIAS=y +CONFIG_DRM=m +CONFIG_DRM_I2C_NXP_TDA998X=m +CONFIG_DRM_TILCDC=m CONFIG_FB=y CONFIG_FIRMWARE_EDID=y CONFIG_FB_MODE_HELPERS=y
Signature · 1 line
1.7.9.5
PATCH 9/9 ARM: OMAP2+: omap2plus_defconfig: Enable BeagleBone Black HDMI audio support
In reply to Jyri SarhaSelect CONFIG_SND_EDMA_SOC=m and CONFIG_SND_AM335X_SOC_NXPTDA_EVM=m for BBB HDMI audio.
--- arch/arm/configs/omap2plus_defconfig | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/configs/omap2plus_defconfig +2 -0
@@ -222,7 +222,9 @@ CONFIG_SND_DEBUG=y CONFIG_SND_USB_AUDIO=m CONFIG_SND_SOC=m CONFIG_SND_OMAP_SOC=m +CONFIG_SND_EDMA_SOC=m CONFIG_SND_AM33XX_SOC_EVM=m +CONFIG_SND_AM335X_SOC_NXPTDA_EVM=m CONFIG_SND_DAVINCI_SOC=m CONFIG_SND_OMAP_SOC_OMAP_TWL4030=m CONFIG_SND_OMAP_SOC_OMAP_ABE_TWL6040=m
Signature · 1 line
1.7.9.5
Re: [PATCH 6/9] ARM: dts: am33xx: Add external clock provider
In reply to Jyri SarhaQuoted 1 line · Jyri Sarha
Add external clock provaider for am33xx devices.
Typo: s/provaider/provider
Signature · 7 lines
Ezequiel García, Free Electrons Embedded Linux, Kernel and Android Engineering http://free-electrons.com -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Hello Jyri,
Quoted 5 lines · Jyri Sarha
The code has a functional dependency to:
http://www.mail-archive.com/[email protected]/msg108199.htmlWithout the above patch the audio card does not probe.
Quoted 8 lines
The code has been rebased on top of Linux 3.16 merged with
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.gitfor-next with http://www.mail-archive.com/[email protected]/msg108199.html
cherry-picked on top.All patches have gone trough some cleaning up since the RFC version of these patches over half a year ago.
To my surprise, this worked out of the box. Did some simple tests with mpg123 and mplayer.
Thanks a lot!
Signature · 3 lines
Ezequiel García, Free Electrons Embedded Linux, Kernel and Android Engineering http://free-electrons.com
Re: [PATCH 1/9] ASoC: mcasp: Fix implicit BLCK divider setting
In reply to Jyri SarhaQuoted 5 lines · Jyri Sarha
The implicit BLCK divider setting was broken by "ASoC: mcasp: don't override bclk divider if it was provided by the machine"-patch. After the BCLK divider is implicitly set for the first time the
mcasp->bclk_divgets a non zero value and the implicit setting is "turned off".
Applied, thanks.