Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge commit 'efc9194bcff84' ("ASoC: hdmi-codec: callback function will be called with private data") into drm-tda998x-devel

This commit is required for the TDA998x ASoC support, so to avoid build
errors, merge this commit into this branch prior to commiting Jiri's
patches.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

+16 -12
+8 -5
include/sound/hdmi-codec.h
··· 53 53 int channels; 54 54 }; 55 55 56 + struct hdmi_codec_pdata; 56 57 struct hdmi_codec_ops { 57 58 /* 58 59 * Called when ASoC starts an audio stream setup. 59 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 65 * Configures HDMI-encoder for audio stream. 65 66 * Mandatory 66 67 */ 67 - int (*hw_params)(struct device *dev, 68 + int (*hw_params)(struct device *dev, void *data, 68 69 struct hdmi_codec_daifmt *fmt, 69 70 struct hdmi_codec_params *hparms); 70 71 ··· 73 72 * Shuts down the audio stream. 74 73 * Mandatory 75 74 */ 76 - void (*audio_shutdown)(struct device *dev); 75 + void (*audio_shutdown)(struct device *dev, void *data); 77 76 78 77 /* 79 78 * Mute/unmute HDMI audio stream. 80 79 * Optional 81 80 */ 82 - int (*digital_mute)(struct device *dev, bool enable); 81 + int (*digital_mute)(struct device *dev, void *data, bool enable); 83 82 84 83 /* 85 84 * Provides EDID-Like-Data from connected HDMI device. 86 85 * Optional 87 86 */ 88 - int (*get_eld)(struct device *dev, uint8_t *buf, size_t len); 87 + int (*get_eld)(struct device *dev, void *data, 88 + uint8_t *buf, size_t len); 89 89 }; 90 90 91 91 /* HDMI codec initalization data */ ··· 95 93 uint i2s:1; 96 94 uint spdif:1; 97 95 int max_i2s_channels; 96 + void *data; 98 97 }; 99 98 100 99 #define HDMI_CODEC_DRV_NAME "hdmi-audio-codec"
+8 -7
sound/soc/codecs/hdmi-codec.c
··· 112 112 return ret; 113 113 114 114 if (hcp->hcd.ops->audio_startup) { 115 - ret = hcp->hcd.ops->audio_startup(dai->dev->parent); 115 + ret = hcp->hcd.ops->audio_startup(dai->dev->parent, hcp->hcd.data); 116 116 if (ret) { 117 117 mutex_lock(&hcp->current_stream_lock); 118 118 hcp->current_stream = NULL; ··· 122 122 } 123 123 124 124 if (hcp->hcd.ops->get_eld) { 125 - ret = hcp->hcd.ops->get_eld(dai->dev->parent, hcp->eld, 126 - sizeof(hcp->eld)); 125 + ret = hcp->hcd.ops->get_eld(dai->dev->parent, hcp->hcd.data, 126 + hcp->eld, sizeof(hcp->eld)); 127 127 128 128 if (!ret) { 129 129 ret = snd_pcm_hw_constraint_eld(substream->runtime, ··· 144 144 145 145 WARN_ON(hcp->current_stream != substream); 146 146 147 - hcp->hcd.ops->audio_shutdown(dai->dev->parent); 147 + hcp->hcd.ops->audio_shutdown(dai->dev->parent, hcp->hcd.data); 148 148 149 149 mutex_lock(&hcp->current_stream_lock); 150 150 hcp->current_stream = NULL; ··· 195 195 hp.sample_rate = params_rate(params); 196 196 hp.channels = params_channels(params); 197 197 198 - return hcp->hcd.ops->hw_params(dai->dev->parent, &hcp->daifmt[dai->id], 199 - &hp); 198 + return hcp->hcd.ops->hw_params(dai->dev->parent, hcp->hcd.data, 199 + &hcp->daifmt[dai->id], &hp); 200 200 } 201 201 202 202 static int hdmi_codec_set_fmt(struct snd_soc_dai *dai, ··· 280 280 dev_dbg(dai->dev, "%s()\n", __func__); 281 281 282 282 if (hcp->hcd.ops->digital_mute) 283 - return hcp->hcd.ops->digital_mute(dai->dev->parent, mute); 283 + return hcp->hcd.ops->digital_mute(dai->dev->parent, 284 + hcp->hcd.data, mute); 284 285 285 286 return 0; 286 287 }