summaryrefslogtreecommitdiffstats
path: root/sound/hda
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2017-01-24 11:24:18 -0500
committerMark Brown <broonie@kernel.org>2017-01-24 11:24:18 -0500
commitdbbc21bbf2c640dd148903e82f752c2f269fc58a (patch)
treee85f5b686774e2fbae6387f94bf44c4076c49046 /sound/hda
parentf6fa11a35c548a516a41ce1669d0dbcdaabb267f (diff)
parent7ce7d89f48834cefece7804d38fc5d85382edf77 (diff)
Merge tag 'v4.10-rc1' into asoc-intel
Linux 4.10-rc1
Diffstat (limited to 'sound/hda')
-rw-r--r--sound/hda/hdac_i915.c18
-rw-r--r--sound/hda/hdac_stream.c6
2 files changed, 15 insertions, 9 deletions
diff --git a/sound/hda/hdac_i915.c b/sound/hda/hdac_i915.c
index c9af022676c2..0659bf389489 100644
--- a/sound/hda/hdac_i915.c
+++ b/sound/hda/hdac_i915.c
@@ -193,6 +193,7 @@ static int pin2port(struct hdac_device *codec, hda_nid_t pin_nid)
193 * snd_hdac_sync_audio_rate - Set N/CTS based on the sample rate 193 * snd_hdac_sync_audio_rate - Set N/CTS based on the sample rate
194 * @codec: HDA codec 194 * @codec: HDA codec
195 * @nid: the pin widget NID 195 * @nid: the pin widget NID
196 * @dev_id: device identifier
196 * @rate: the sample rate to set 197 * @rate: the sample rate to set
197 * 198 *
198 * This function is supposed to be used only by a HD-audio controller 199 * This function is supposed to be used only by a HD-audio controller
@@ -201,18 +202,20 @@ static int pin2port(struct hdac_device *codec, hda_nid_t pin_nid)
201 * This function sets N/CTS value based on the given sample rate. 202 * This function sets N/CTS value based on the given sample rate.
202 * Returns zero for success, or a negative error code. 203 * Returns zero for success, or a negative error code.
203 */ 204 */
204int snd_hdac_sync_audio_rate(struct hdac_device *codec, hda_nid_t nid, int rate) 205int snd_hdac_sync_audio_rate(struct hdac_device *codec, hda_nid_t nid,
206 int dev_id, int rate)
205{ 207{
206 struct hdac_bus *bus = codec->bus; 208 struct hdac_bus *bus = codec->bus;
207 struct i915_audio_component *acomp = bus->audio_component; 209 struct i915_audio_component *acomp = bus->audio_component;
208 int port; 210 int port, pipe;
209 211
210 if (!acomp || !acomp->ops || !acomp->ops->sync_audio_rate) 212 if (!acomp || !acomp->ops || !acomp->ops->sync_audio_rate)
211 return -ENODEV; 213 return -ENODEV;
212 port = pin2port(codec, nid); 214 port = pin2port(codec, nid);
213 if (port < 0) 215 if (port < 0)
214 return -EINVAL; 216 return -EINVAL;
215 return acomp->ops->sync_audio_rate(acomp->dev, port, rate); 217 pipe = dev_id;
218 return acomp->ops->sync_audio_rate(acomp->dev, port, pipe, rate);
216} 219}
217EXPORT_SYMBOL_GPL(snd_hdac_sync_audio_rate); 220EXPORT_SYMBOL_GPL(snd_hdac_sync_audio_rate);
218 221
@@ -220,6 +223,7 @@ EXPORT_SYMBOL_GPL(snd_hdac_sync_audio_rate);
220 * snd_hdac_acomp_get_eld - Get the audio state and ELD via component 223 * snd_hdac_acomp_get_eld - Get the audio state and ELD via component
221 * @codec: HDA codec 224 * @codec: HDA codec
222 * @nid: the pin widget NID 225 * @nid: the pin widget NID
226 * @dev_id: device identifier
223 * @audio_enabled: the pointer to store the current audio state 227 * @audio_enabled: the pointer to store the current audio state
224 * @buffer: the buffer pointer to store ELD bytes 228 * @buffer: the buffer pointer to store ELD bytes
225 * @max_bytes: the max bytes to be stored on @buffer 229 * @max_bytes: the max bytes to be stored on @buffer
@@ -236,12 +240,12 @@ EXPORT_SYMBOL_GPL(snd_hdac_sync_audio_rate);
236 * thus it may be over @max_bytes. If it's over @max_bytes, it implies 240 * thus it may be over @max_bytes. If it's over @max_bytes, it implies
237 * that only a part of ELD bytes have been fetched. 241 * that only a part of ELD bytes have been fetched.
238 */ 242 */
239int snd_hdac_acomp_get_eld(struct hdac_device *codec, hda_nid_t nid, 243int snd_hdac_acomp_get_eld(struct hdac_device *codec, hda_nid_t nid, int dev_id,
240 bool *audio_enabled, char *buffer, int max_bytes) 244 bool *audio_enabled, char *buffer, int max_bytes)
241{ 245{
242 struct hdac_bus *bus = codec->bus; 246 struct hdac_bus *bus = codec->bus;
243 struct i915_audio_component *acomp = bus->audio_component; 247 struct i915_audio_component *acomp = bus->audio_component;
244 int port; 248 int port, pipe;
245 249
246 if (!acomp || !acomp->ops || !acomp->ops->get_eld) 250 if (!acomp || !acomp->ops || !acomp->ops->get_eld)
247 return -ENODEV; 251 return -ENODEV;
@@ -249,7 +253,9 @@ int snd_hdac_acomp_get_eld(struct hdac_device *codec, hda_nid_t nid,
249 port = pin2port(codec, nid); 253 port = pin2port(codec, nid);
250 if (port < 0) 254 if (port < 0)
251 return -EINVAL; 255 return -EINVAL;
252 return acomp->ops->get_eld(acomp->dev, port, audio_enabled, 256
257 pipe = dev_id;
258 return acomp->ops->get_eld(acomp->dev, port, pipe, audio_enabled,
253 buffer, max_bytes); 259 buffer, max_bytes);
254} 260}
255EXPORT_SYMBOL_GPL(snd_hdac_acomp_get_eld); 261EXPORT_SYMBOL_GPL(snd_hdac_acomp_get_eld);
diff --git a/sound/hda/hdac_stream.c b/sound/hda/hdac_stream.c
index 38990a77d7b7..c6994ebb4567 100644
--- a/sound/hda/hdac_stream.c
+++ b/sound/hda/hdac_stream.c
@@ -465,7 +465,7 @@ int snd_hdac_stream_set_params(struct hdac_stream *azx_dev,
465} 465}
466EXPORT_SYMBOL_GPL(snd_hdac_stream_set_params); 466EXPORT_SYMBOL_GPL(snd_hdac_stream_set_params);
467 467
468static cycle_t azx_cc_read(const struct cyclecounter *cc) 468static u64 azx_cc_read(const struct cyclecounter *cc)
469{ 469{
470 struct hdac_stream *azx_dev = container_of(cc, struct hdac_stream, cc); 470 struct hdac_stream *azx_dev = container_of(cc, struct hdac_stream, cc);
471 471
@@ -473,7 +473,7 @@ static cycle_t azx_cc_read(const struct cyclecounter *cc)
473} 473}
474 474
475static void azx_timecounter_init(struct hdac_stream *azx_dev, 475static void azx_timecounter_init(struct hdac_stream *azx_dev,
476 bool force, cycle_t last) 476 bool force, u64 last)
477{ 477{
478 struct timecounter *tc = &azx_dev->tc; 478 struct timecounter *tc = &azx_dev->tc;
479 struct cyclecounter *cc = &azx_dev->cc; 479 struct cyclecounter *cc = &azx_dev->cc;
@@ -523,7 +523,7 @@ void snd_hdac_stream_timecounter_init(struct hdac_stream *azx_dev,
523 struct snd_pcm_runtime *runtime = azx_dev->substream->runtime; 523 struct snd_pcm_runtime *runtime = azx_dev->substream->runtime;
524 struct hdac_stream *s; 524 struct hdac_stream *s;
525 bool inited = false; 525 bool inited = false;
526 cycle_t cycle_last = 0; 526 u64 cycle_last = 0;
527 int i = 0; 527 int i = 0;
528 528
529 list_for_each_entry(s, &bus->stream_list, list) { 529 list_for_each_entry(s, &bus->stream_list, list) {