diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2016-06-23 22:47:55 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-06-27 13:53:15 -0400 |
commit | efc9194bcff84666832c6493bafa92029ac6634c (patch) | |
tree | 5606d09a3a392ec3b8c401c762259cd7f7a509ce /include/sound | |
parent | 1a695a905c18548062509178b98bc91e67510864 (diff) |
ASoC: hdmi-codec: callback function will be called with private data
Current hdmi-codec driver is assuming that it will be registered
from HDMI driver. Because of this assumption, each callback function
has struct device pointer which is parent device (= HDMI).
Then, it can use dev_get_drvdata() to get private data.
OTOH, on some SoC/HDMI case, SoC has VIDEO/SOUND and HDMI IPs.
This case, it needs SoC VIDEO, SoC SOUND and HDMI video, HDMI codec
driver. In DesignWare HDMI IP case, SoC VIDEO (= DRM/KMS) driver tries
to bind DesignWare HDMI video driver, and HDMI codec driver
(= hdmi-codec). This case, above "parent device" of HDMI codec driver
is DRM/KMS driver and its "device" already has private data.
And, from DT and ASoC CPU/Codec/Card binding point of view, HDMI codec
(= hdmi-codec) needs to have "parent device" (= DRM/KMS), otherwise,
it never detect sound card.
Because of these reasons, some driver can't use dev_get_drvdata() to
get private data on hdmi-codec driver. This patch add new void pointer
on hdmi_codec_pdata for private data, and callback function will be
called with it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/sound')
-rw-r--r-- | include/sound/hdmi-codec.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/include/sound/hdmi-codec.h b/include/sound/hdmi-codec.h index fc3a481ad91e..530c57bdefa0 100644 --- a/include/sound/hdmi-codec.h +++ b/include/sound/hdmi-codec.h | |||
@@ -53,18 +53,19 @@ struct hdmi_codec_params { | |||
53 | int channels; | 53 | int channels; |
54 | }; | 54 | }; |
55 | 55 | ||
56 | struct hdmi_codec_pdata; | ||
56 | struct hdmi_codec_ops { | 57 | struct hdmi_codec_ops { |
57 | /* | 58 | /* |
58 | * Called when ASoC starts an audio stream setup. | 59 | * Called when ASoC starts an audio stream setup. |
59 | * Optional | 60 | * Optional |
60 | */ | 61 | */ |
61 | int (*audio_startup)(struct device *dev); | 62 | int (*audio_startup)(struct device *dev, void *data); |
62 | 63 | ||
63 | /* | 64 | /* |
64 | * Configures HDMI-encoder for audio stream. | 65 | * Configures HDMI-encoder for audio stream. |
65 | * Mandatory | 66 | * Mandatory |
66 | */ | 67 | */ |
67 | int (*hw_params)(struct device *dev, | 68 | int (*hw_params)(struct device *dev, void *data, |
68 | struct hdmi_codec_daifmt *fmt, | 69 | struct hdmi_codec_daifmt *fmt, |
69 | struct hdmi_codec_params *hparms); | 70 | struct hdmi_codec_params *hparms); |
70 | 71 | ||
@@ -72,19 +73,20 @@ struct hdmi_codec_ops { | |||
72 | * Shuts down the audio stream. | 73 | * Shuts down the audio stream. |
73 | * Mandatory | 74 | * Mandatory |
74 | */ | 75 | */ |
75 | void (*audio_shutdown)(struct device *dev); | 76 | void (*audio_shutdown)(struct device *dev, void *data); |
76 | 77 | ||
77 | /* | 78 | /* |
78 | * Mute/unmute HDMI audio stream. | 79 | * Mute/unmute HDMI audio stream. |
79 | * Optional | 80 | * Optional |
80 | */ | 81 | */ |
81 | int (*digital_mute)(struct device *dev, bool enable); | 82 | int (*digital_mute)(struct device *dev, void *data, bool enable); |
82 | 83 | ||
83 | /* | 84 | /* |
84 | * Provides EDID-Like-Data from connected HDMI device. | 85 | * Provides EDID-Like-Data from connected HDMI device. |
85 | * Optional | 86 | * Optional |
86 | */ | 87 | */ |
87 | int (*get_eld)(struct device *dev, uint8_t *buf, size_t len); | 88 | int (*get_eld)(struct device *dev, void *data, |
89 | uint8_t *buf, size_t len); | ||
88 | }; | 90 | }; |
89 | 91 | ||
90 | /* HDMI codec initalization data */ | 92 | /* HDMI codec initalization data */ |
@@ -93,6 +95,7 @@ struct hdmi_codec_pdata { | |||
93 | uint i2s:1; | 95 | uint i2s:1; |
94 | uint spdif:1; | 96 | uint spdif:1; |
95 | int max_i2s_channels; | 97 | int max_i2s_channels; |
98 | void *data; | ||
96 | }; | 99 | }; |
97 | 100 | ||
98 | #define HDMI_CODEC_DRV_NAME "hdmi-audio-codec" | 101 | #define HDMI_CODEC_DRV_NAME "hdmi-audio-codec" |