Commit 8506912b authored by Dave Airlie's avatar Dave Airlie

Merge branch 'drm-tda998x-devel' of git://git.armlinux.org.uk/~rmk/linux-arm into drm-next

This adds the ASoC codec interfaces for TDA998x HDMI audio from
Jyri Sarha.

* 'drm-tda998x-devel' of git://git.armlinux.org.uk/~rmk/linux-arm:
  ARM: dts: am335x-boneblack: Add HDMI audio support
  drm/i2c: tda998x: Register ASoC hdmi-codec and add audio DT binding
  drm/i2c: tda998x: Improve tda998x_configure_audio() audio related pdata
parents b4eac546 df0bd1e8
...@@ -21,8 +21,19 @@ Optional properties: ...@@ -21,8 +21,19 @@ Optional properties:
- video-ports: 24 bits value which defines how the video controller - video-ports: 24 bits value which defines how the video controller
output is wired to the TDA998x input - default: <0x230145> output is wired to the TDA998x input - default: <0x230145>
- audio-ports: array of 8-bit values, 2 values per one DAI[1].
The first value defines the DAI type: TDA998x_SPDIF or TDA998x_I2S[2].
The second value defines the tda998x AP_ENA reg content when the DAI
in question is used. The implementation allows one or two DAIs. If two
DAIs are defined, they must be of different type.
[1] Documentation/sound/alsa/soc/DAI.txt
[2] include/dt-bindings/display/tda998x.h
Example: Example:
#include <dt-bindings/display/tda998x.h>
tda998x: hdmi-encoder { tda998x: hdmi-encoder {
compatible = "nxp,tda998x"; compatible = "nxp,tda998x";
reg = <0x70>; reg = <0x70>;
...@@ -30,4 +41,11 @@ Example: ...@@ -30,4 +41,11 @@ Example:
interrupts = <27 2>; /* falling edge */ interrupts = <27 2>; /* falling edge */
pinctrl-0 = <&pmx_camera>; pinctrl-0 = <&pmx_camera>;
pinctrl-names = "default"; pinctrl-names = "default";
video-ports = <0x230145>;
#sound-dai-cells = <2>;
/* DAI-format AP_ENA reg value */
audio-ports = < TDA998x_SPDIF 0x04
TDA998x_I2S 0x03>;
}; };
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "am33xx.dtsi" #include "am33xx.dtsi"
#include "am335x-bone-common.dtsi" #include "am335x-bone-common.dtsi"
#include <dt-bindings/display/tda998x.h>
/ { / {
model = "TI AM335x BeagleBone Black"; model = "TI AM335x BeagleBone Black";
...@@ -75,6 +76,16 @@ nxp_hdmi_bonelt_off_pins: nxp_hdmi_bonelt_off_pins { ...@@ -75,6 +76,16 @@ nxp_hdmi_bonelt_off_pins: nxp_hdmi_bonelt_off_pins {
AM33XX_IOPAD(0x9b0, PIN_OUTPUT_PULLDOWN | MUX_MODE3) /* xdma_event_intr0 */ AM33XX_IOPAD(0x9b0, PIN_OUTPUT_PULLDOWN | MUX_MODE3) /* xdma_event_intr0 */
>; >;
}; };
mcasp0_pins: mcasp0_pins {
pinctrl-single,pins = <
AM33XX_IOPAD(0x9ac, PIN_INPUT_PULLUP | MUX_MODE0) /* mcasp0_ahcklx.mcasp0_ahclkx */
AM33XX_IOPAD(0x99c, PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* mcasp0_ahclkr.mcasp0_axr2*/
AM33XX_IOPAD(0x994, PIN_OUTPUT_PULLUP | MUX_MODE0) /* mcasp0_fsx.mcasp0_fsx */
AM33XX_IOPAD(0x990, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* mcasp0_aclkx.mcasp0_aclkx */
AM33XX_IOPAD(0x86c, PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a11.GPIO1_27 */
>;
};
}; };
&lcdc { &lcdc {
...@@ -87,16 +98,22 @@ lcdc_0: endpoint@0 { ...@@ -87,16 +98,22 @@ lcdc_0: endpoint@0 {
}; };
&i2c0 { &i2c0 {
tda19988 { tda19988: tda19988 {
compatible = "nxp,tda998x"; compatible = "nxp,tda998x";
reg = <0x70>; reg = <0x70>;
pinctrl-names = "default", "off"; pinctrl-names = "default", "off";
pinctrl-0 = <&nxp_hdmi_bonelt_pins>; pinctrl-0 = <&nxp_hdmi_bonelt_pins>;
pinctrl-1 = <&nxp_hdmi_bonelt_off_pins>; pinctrl-1 = <&nxp_hdmi_bonelt_off_pins>;
port { #sound-dai-cells = <0>;
hdmi_0: endpoint@0 { audio-ports = < TDA998x_I2S 0x03>;
remote-endpoint = <&lcdc_0>;
ports {
port@0 {
hdmi_0: endpoint@0 {
remote-endpoint = <&lcdc_0>;
};
}; };
}; };
}; };
...@@ -105,3 +122,49 @@ hdmi_0: endpoint@0 { ...@@ -105,3 +122,49 @@ hdmi_0: endpoint@0 {
&rtc { &rtc {
system-power-controller; system-power-controller;
}; };
&mcasp0 {
#sound-dai-cells = <0>;
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 = <32>;
rx-num-evt = <32>;
};
/ {
clk_mcasp0_fixed: clk_mcasp0_fixed {
#clock-cells = <0>;
compatible = "fixed-clock";
clock-frequency = <24576000>;
};
clk_mcasp0: clk_mcasp0 {
#clock-cells = <0>;
compatible = "gpio-gate-clock";
clocks = <&clk_mcasp0_fixed>;
enable-gpios = <&gpio1 27 0>; /* BeagleBone Black Clk enable on GPIO1_27 */
};
sound {
compatible = "simple-audio-card";
simple-audio-card,name = "TI BeagleBone Black";
simple-audio-card,format = "i2s";
simple-audio-card,bitclock-master = <&dailink0_master>;
simple-audio-card,frame-master = <&dailink0_master>;
dailink0_master: simple-audio-card,cpu {
sound-dai = <&mcasp0>;
clocks = <&clk_mcasp0>;
};
simple-audio-card,codec {
sound-dai = <&tda19988>;
};
};
};
...@@ -22,6 +22,7 @@ config DRM_I2C_SIL164 ...@@ -22,6 +22,7 @@ config DRM_I2C_SIL164
config DRM_I2C_NXP_TDA998X config DRM_I2C_NXP_TDA998X
tristate "NXP Semiconductors TDA998X HDMI encoder" tristate "NXP Semiconductors TDA998X HDMI encoder"
default m if DRM_TILCDC default m if DRM_TILCDC
select SND_SOC_HDMI_CODEC if SND_SOC
help help
Support for NXP Semiconductors TDA998X HDMI encoders. Support for NXP Semiconductors TDA998X HDMI encoders.
......
This diff is collapsed.
#ifndef __DRM_I2C_TDA998X_H__ #ifndef __DRM_I2C_TDA998X_H__
#define __DRM_I2C_TDA998X_H__ #define __DRM_I2C_TDA998X_H__
#include <linux/hdmi.h>
#include <dt-bindings/display/tda998x.h>
enum {
AFMT_UNUSED = 0,
AFMT_SPDIF = TDA998x_SPDIF,
AFMT_I2S = TDA998x_I2S,
};
struct tda998x_audio_params {
u8 config;
u8 format;
unsigned sample_width;
unsigned sample_rate;
struct hdmi_audio_infoframe cea;
u8 status[5];
};
struct tda998x_encoder_params { struct tda998x_encoder_params {
u8 swap_b:3; u8 swap_b:3;
u8 mirr_b:1; u8 mirr_b:1;
...@@ -15,16 +33,7 @@ struct tda998x_encoder_params { ...@@ -15,16 +33,7 @@ struct tda998x_encoder_params {
u8 swap_e:3; u8 swap_e:3;
u8 mirr_e:1; u8 mirr_e:1;
u8 audio_cfg; struct tda998x_audio_params audio_params;
u8 audio_clk_cfg;
u8 audio_frame[6];
enum {
AFMT_SPDIF,
AFMT_I2S
} audio_format;
unsigned audio_sample_rate;
}; };
#endif #endif
#ifndef _DT_BINDINGS_TDA998X_H
#define _DT_BINDINGS_TDA998X_H
#define TDA998x_SPDIF 1
#define TDA998x_I2S 2
#endif /*_DT_BINDINGS_TDA998X_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment