diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2020-01-29 03:26:57 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2020-01-29 03:26:57 +0300 |
commit | fb95aae6e67c4e319a24b3eea32032d4246a5335 (patch) | |
tree | c310d68211634ef594d180fdd93844fec44de2fe /sound/hda | |
parent | bd2463ac7d7ec51d432f23bf0e893fb371a908cd (diff) | |
parent | 90fb04f890bcb7384b4d4c216dc2640b0a870df3 (diff) | |
download | linux-fb95aae6e67c4e319a24b3eea32032d4246a5335.tar.xz |
Merge tag 'sound-5.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound updates from Takashi Iwai:
"As the diffstat shows we've had again a lot of works done for this
cycle: the majority of changes are the continued componentization and
code refactoring in ASoC, the tree-wide PCM API updates and cleanups
and SOF updates while a few ASoC driver updates are seen, too.
Here we go, some highlights:
Core:
- Finally y2038 support landed to ALSA ABI; some ioctls have been
extended and lots of tricks were applied
- Applying the new managed PCM buffer API to all drivers; the API
itself was already merged in 5.5
- The already deprecated dimension support in ALSA control API is
dropped completely now
- Verification of ALSA control elements to catch API misuses
ASoC:
- Further code refactorings and moving things to the component level
- Lots of updates and improvements on SOF / Intel drivers; now
including common HDMI driver and SoundWire support
- New driver support for Ingenic JZ4770, Mediatek MT6660, Qualcomm
WCD934x and WSA881x, and Realtek RT700, RT711, RT715, RT1011,
RT1015 and RT1308
HD-audio:
- Improved ring-buffer communications using waitqueue
- Drop the superfluous buffer preallocation on x86
Others:
- Many code cleanups, mostly constifications over the whole tree
- USB-audio: quirks for MOTU, Corsair Virtuoso, Line6 Helix
- FireWire: code refactoring for oxfw and dice drivers"
* tag 'sound-5.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (638 commits)
ALSA: usb-audio: add quirks for Line6 Helix devices fw>=2.82
ALSA: hda: Add Clevo W65_67SB the power_save blacklist
ASoC: soc-core: remove null_snd_soc_ops
ASoC: soc-pcm: add soc_rtd_trigger()
ASoC: soc-pcm: add soc_rtd_hw_free()
ASoC: soc-pcm: add soc_rtd_hw_params()
ASoC: soc-pcm: add soc_rtd_prepare()
ASoC: soc-pcm: add soc_rtd_shutdown()
ASoC: soc-pcm: add soc_rtd_startup()
ASoC: rt1015: add rt1015 amplifier driver
ASoC: madera: Correct some kernel doc
ASoC: topology: fix soc_tplg_fe_link_create() - link->dobj initialization order
ASoC: Intel: skl_hda_dsp_common: Fix global-out-of-bounds bug
ASoC: madera: Correct DMIC only input hook ups
ALSA: cs46xx: fix spelling mistake "to" -> "too"
ALSA: hda - Add docking station support for Lenovo Thinkpad T420s
ASoC: Add MediaTek MT6660 Speaker Amp Driver
ASoC: dt-bindings: rt5645: add suppliers
ASoC: max98090: fix deadlock in max98090_dapm_put_enum_double()
ASoC: dapm: add snd_soc_dapm_put_enum_double_locked
...
Diffstat (limited to 'sound/hda')
-rw-r--r-- | sound/hda/Kconfig | 6 | ||||
-rw-r--r-- | sound/hda/ext/hdac_ext_bus.c | 11 | ||||
-rw-r--r-- | sound/hda/ext/hdac_ext_controller.c | 14 | ||||
-rw-r--r-- | sound/hda/ext/hdac_ext_stream.c | 1 | ||||
-rw-r--r-- | sound/hda/hdac_bus.c | 4 | ||||
-rw-r--r-- | sound/hda/hdac_component.c | 1 | ||||
-rw-r--r-- | sound/hda/hdac_controller.c | 31 | ||||
-rw-r--r-- | sound/hda/hdac_device.c | 17 | ||||
-rw-r--r-- | sound/hda/hdac_regmap.c | 144 | ||||
-rw-r--r-- | sound/hda/hdac_stream.c | 2 | ||||
-rw-r--r-- | sound/hda/hdmi_chmap.c | 2 | ||||
-rw-r--r-- | sound/hda/intel-nhlt.c | 2 |
12 files changed, 173 insertions, 62 deletions
diff --git a/sound/hda/Kconfig b/sound/hda/Kconfig index b0c88fe040ee..4ca6b09056f3 100644 --- a/sound/hda/Kconfig +++ b/sound/hda/Kconfig @@ -21,14 +21,16 @@ config SND_HDA_EXT_CORE select SND_HDA_CORE config SND_HDA_PREALLOC_SIZE - int "Pre-allocated buffer size for HD-audio driver" + int "Pre-allocated buffer size for HD-audio driver" if !SND_DMA_SGBUF range 0 32768 - default 64 + default 0 if SND_DMA_SGBUF + default 64 if !SND_DMA_SGBUF help Specifies the default pre-allocated buffer-size in kB for the HD-audio driver. A larger buffer (e.g. 2048) is preferred for systems using PulseAudio. The default 64 is chosen just for compatibility reasons. + On x86 systems, the default is zero as we need no preallocation. Note that the pre-allocation size can be changed dynamically via a proc file (/proc/asound/card*/pcm*/sub*/prealloc), too. diff --git a/sound/hda/ext/hdac_ext_bus.c b/sound/hda/ext/hdac_ext_bus.c index 242306d820ec..73bfa71845f6 100644 --- a/sound/hda/ext/hdac_ext_bus.c +++ b/sound/hda/ext/hdac_ext_bus.c @@ -19,10 +19,10 @@ MODULE_LICENSE("GPL v2"); /** * snd_hdac_ext_bus_init - initialize a HD-audio extended bus - * @ebus: the pointer to extended bus object + * @bus: the pointer to HDAC bus object * @dev: device pointer * @ops: bus verb operators - * default ops + * @ext_ops: operators used for ASoC HDA codec drivers * * Returns 0 if successful, or a negative error code. */ @@ -51,7 +51,7 @@ EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_init); /** * snd_hdac_ext_bus_exit - clean up a HD-audio extended bus - * @ebus: the pointer to extended bus object + * @bus: the pointer to HDAC bus object */ void snd_hdac_ext_bus_exit(struct hdac_bus *bus) { @@ -67,8 +67,9 @@ static void default_release(struct device *dev) /** * snd_hdac_ext_bus_device_init - initialize the HDA extended codec base device - * @ebus: hdac extended bus to attach to + * @bus: hdac bus to attach to * @addr: codec address + * @hdev: hdac device to init * * Returns zero for success or a negative error code. */ @@ -114,7 +115,7 @@ EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_device_exit); /** * snd_hdac_ext_bus_device_remove - remove HD-audio extended codec base devices * - * @ebus: HD-audio extended bus + * @bus: the pointer to HDAC bus object */ void snd_hdac_ext_bus_device_remove(struct hdac_bus *bus) { diff --git a/sound/hda/ext/hdac_ext_controller.c b/sound/hda/ext/hdac_ext_controller.c index cfab60d88c92..a684f0520b4b 100644 --- a/sound/hda/ext/hdac_ext_controller.c +++ b/sound/hda/ext/hdac_ext_controller.c @@ -28,7 +28,7 @@ /** * snd_hdac_ext_bus_ppcap_enable - enable/disable processing pipe capability - * @ebus: HD-audio extended core bus + * @bus: the pointer to HDAC bus object * @enable: flag to turn on/off the capability */ void snd_hdac_ext_bus_ppcap_enable(struct hdac_bus *bus, bool enable) @@ -50,7 +50,7 @@ EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_ppcap_enable); /** * snd_hdac_ext_bus_ppcap_int_enable - ppcap interrupt enable/disable - * @ebus: HD-audio extended core bus + * @bus: the pointer to HDAC bus object * @enable: flag to enable/disable interrupt */ void snd_hdac_ext_bus_ppcap_int_enable(struct hdac_bus *bus, bool enable) @@ -77,7 +77,7 @@ EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_ppcap_int_enable); /** * snd_hdac_ext_bus_get_ml_capabilities - get multilink capability - * @ebus: HD-audio extended core bus + * @bus: the pointer to HDAC bus object * * This will parse all links and read the mlink capabilities and add them * in hlink_list of extended hdac bus @@ -117,7 +117,7 @@ EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_get_ml_capabilities); /** * snd_hdac_link_free_all- free hdac extended link objects * - * @ebus: HD-audio ext core bus + * @bus: the pointer to HDAC bus object */ void snd_hdac_link_free_all(struct hdac_bus *bus) @@ -134,7 +134,7 @@ EXPORT_SYMBOL_GPL(snd_hdac_link_free_all); /** * snd_hdac_ext_bus_get_link_index - get link based on codec name - * @ebus: HD-audio extended core bus + * @bus: the pointer to HDAC bus object * @codec_name: codec name */ struct hdac_ext_link *snd_hdac_ext_bus_get_link(struct hdac_bus *bus, @@ -211,7 +211,7 @@ EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_link_power_down); /** * snd_hdac_ext_bus_link_power_up_all -power up all hda link - * @ebus: HD-audio extended bus + * @bus: the pointer to HDAC bus object */ int snd_hdac_ext_bus_link_power_up_all(struct hdac_bus *bus) { @@ -232,7 +232,7 @@ EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_link_power_up_all); /** * snd_hdac_ext_bus_link_power_down_all -power down all hda link - * @ebus: HD-audio extended bus + * @bus: the pointer to HDAC bus object */ int snd_hdac_ext_bus_link_power_down_all(struct hdac_bus *bus) { diff --git a/sound/hda/ext/hdac_ext_stream.c b/sound/hda/ext/hdac_ext_stream.c index 6b1b4b834bae..c4d54a838773 100644 --- a/sound/hda/ext/hdac_ext_stream.c +++ b/sound/hda/ext/hdac_ext_stream.c @@ -530,7 +530,6 @@ EXPORT_SYMBOL_GPL(snd_hdac_ext_stream_set_dpibr); /** * snd_hdac_ext_stream_set_lpib - sets the lpib value of a stream - * @bus: HD-audio core bus * @stream: hdac_ext_stream * @value: lpib value to set */ diff --git a/sound/hda/hdac_bus.c b/sound/hda/hdac_bus.c index 8f19876244eb..3fe62be1cbcc 100644 --- a/sound/hda/hdac_bus.c +++ b/sound/hda/hdac_bus.c @@ -22,6 +22,7 @@ static const struct hdac_bus_ops default_ops = { /** * snd_hdac_bus_init - initialize a HD-audio bas bus * @bus: the pointer to bus object + * @dev: device pointer * @ops: bus verb operators * * Returns 0 if successful, or a negative error code. @@ -43,6 +44,7 @@ int snd_hdac_bus_init(struct hdac_bus *bus, struct device *dev, mutex_init(&bus->cmd_mutex); mutex_init(&bus->lock); INIT_LIST_HEAD(&bus->hlink_list); + init_waitqueue_head(&bus->rirb_wq); bus->irq = -1; return 0; } @@ -63,6 +65,7 @@ EXPORT_SYMBOL_GPL(snd_hdac_bus_exit); /** * snd_hdac_bus_exec_verb - execute a HD-audio verb on the given bus * @bus: bus object + * @addr: the HDAC device address * @cmd: HD-audio encoded verb * @res: pointer to store the response, NULL if performing asynchronously * @@ -83,6 +86,7 @@ EXPORT_SYMBOL_GPL(snd_hdac_bus_exec_verb); /** * snd_hdac_bus_exec_verb_unlocked - unlocked version * @bus: bus object + * @addr: the HDAC device address * @cmd: HD-audio encoded verb * @res: pointer to store the response, NULL if performing asynchronously * diff --git a/sound/hda/hdac_component.c b/sound/hda/hdac_component.c index dfe7e755f594..89126c6fd216 100644 --- a/sound/hda/hdac_component.c +++ b/sound/hda/hdac_component.c @@ -262,6 +262,7 @@ EXPORT_SYMBOL_GPL(snd_hdac_acomp_register_notifier); /** * snd_hdac_acomp_init - Initialize audio component * @bus: HDA core bus + * @aops: audio component ops * @match_master: match function for finding components * @extra_size: Extra bytes to allocate * diff --git a/sound/hda/hdac_controller.c b/sound/hda/hdac_controller.c index 7e7be8e4dcf9..bc4a8b606020 100644 --- a/sound/hda/hdac_controller.c +++ b/sound/hda/hdac_controller.c @@ -181,6 +181,7 @@ EXPORT_SYMBOL_GPL(snd_hdac_bus_send_cmd); * @bus: HD-audio core bus * * Usually called from interrupt handler. + * The caller needs bus->reg_lock spinlock before calling this. */ void snd_hdac_bus_update_rirb(struct hdac_bus *bus) { @@ -216,6 +217,9 @@ void snd_hdac_bus_update_rirb(struct hdac_bus *bus) else if (bus->rirb.cmds[addr]) { bus->rirb.res[addr] = res; bus->rirb.cmds[addr]--; + if (!bus->rirb.cmds[addr] && + waitqueue_active(&bus->rirb_wq)) + wake_up(&bus->rirb_wq); } else { dev_err_ratelimited(bus->dev, "spurious response %#x:%#x, last cmd=%#08x\n", @@ -238,30 +242,51 @@ int snd_hdac_bus_get_response(struct hdac_bus *bus, unsigned int addr, { unsigned long timeout; unsigned long loopcounter; + wait_queue_entry_t wait; + bool warned = false; + init_wait_entry(&wait, 0); timeout = jiffies + msecs_to_jiffies(1000); for (loopcounter = 0;; loopcounter++) { spin_lock_irq(&bus->reg_lock); + if (!bus->polling_mode) + prepare_to_wait(&bus->rirb_wq, &wait, + TASK_UNINTERRUPTIBLE); if (bus->polling_mode) snd_hdac_bus_update_rirb(bus); if (!bus->rirb.cmds[addr]) { if (res) *res = bus->rirb.res[addr]; /* the last value */ + if (!bus->polling_mode) + finish_wait(&bus->rirb_wq, &wait); spin_unlock_irq(&bus->reg_lock); return 0; } spin_unlock_irq(&bus->reg_lock); if (time_after(jiffies, timeout)) break; - if (loopcounter > 3000) +#define LOOP_COUNT_MAX 3000 + if (!bus->polling_mode) { + schedule_timeout(msecs_to_jiffies(2)); + } else if (bus->needs_damn_long_delay || + loopcounter > LOOP_COUNT_MAX) { + if (loopcounter > LOOP_COUNT_MAX && !warned) { + dev_dbg_ratelimited(bus->dev, + "too slow response, last cmd=%#08x\n", + bus->last_cmd[addr]); + warned = true; + } msleep(2); /* temporary workaround */ - else { + } else { udelay(10); cond_resched(); } } + if (!bus->polling_mode) + finish_wait(&bus->rirb_wq, &wait); + return -EIO; } EXPORT_SYMBOL_GPL(snd_hdac_bus_get_response); @@ -536,7 +561,7 @@ EXPORT_SYMBOL_GPL(snd_hdac_bus_stop_chip); * snd_hdac_bus_handle_stream_irq - interrupt handler for streams * @bus: HD-audio core bus * @status: INTSTS register value - * @ask: callback to be called for woken streams + * @ack: callback to be called for woken streams * * Returns the bits of handled streams, or zero if no stream is handled. */ diff --git a/sound/hda/hdac_device.c b/sound/hda/hdac_device.c index 9f3e37511408..9a526aeef8da 100644 --- a/sound/hda/hdac_device.c +++ b/sound/hda/hdac_device.c @@ -57,6 +57,7 @@ int snd_hdac_device_init(struct hdac_device *codec, struct hdac_bus *bus, codec->addr = addr; codec->type = HDA_DEV_CORE; mutex_init(&codec->widget_lock); + mutex_init(&codec->regmap_lock); pm_runtime_set_active(&codec->dev); pm_runtime_get_noresume(&codec->dev); atomic_set(&codec->in_pm, 0); @@ -134,7 +135,7 @@ EXPORT_SYMBOL_GPL(snd_hdac_device_exit); /** * snd_hdac_device_register - register the hd-audio codec base device - * codec: the device to register + * @codec: the device to register */ int snd_hdac_device_register(struct hdac_device *codec) { @@ -157,7 +158,7 @@ EXPORT_SYMBOL_GPL(snd_hdac_device_register); /** * snd_hdac_device_unregister - unregister the hd-audio codec base device - * codec: the device to unregister + * @codec: the device to unregister */ void snd_hdac_device_unregister(struct hdac_device *codec) { @@ -280,6 +281,10 @@ EXPORT_SYMBOL_GPL(snd_hdac_read); /** * _snd_hdac_read_parm - read a parmeter + * @codec: the codec object + * @nid: NID to read a parameter + * @parm: parameter to read + * @res: pointer to store the read value * * This function returns zero or an error unlike snd_hdac_read_parm(). */ @@ -637,7 +642,7 @@ struct hda_vendor_id { const char *name; }; -static struct hda_vendor_id hda_vendor_ids[] = { +static const struct hda_vendor_id hda_vendor_ids[] = { { 0x1002, "ATI" }, { 0x1013, "Cirrus Logic" }, { 0x1057, "Motorola" }, @@ -692,7 +697,7 @@ struct hda_rate_tbl { (AC_FMT_BASE_##base##K | (((mult) - 1) << AC_FMT_MULT_SHIFT) | \ (((div) - 1) << AC_FMT_DIV_SHIFT)) -static struct hda_rate_tbl rate_bits[] = { +static const struct hda_rate_tbl rate_bits[] = { /* rate in Hz, ALSA rate bitmask, HDA format value */ /* autodetected value used in snd_hda_query_supported_pcm */ @@ -1061,9 +1066,9 @@ EXPORT_SYMBOL_GPL(snd_hdac_check_power_state); * snd_hdac_sync_power_state - wait until actual power state matches * with the target state * - * @hdac: the HDAC device + * @codec: the HDAC device * @nid: NID to send the command - * @target_state: target state to check for + * @power_state: target power state to wait for * * Return power state or PS_ERROR if codec rejects GET verb. */ diff --git a/sound/hda/hdac_regmap.c b/sound/hda/hdac_regmap.c index 286361ecd640..d75f31eb9d78 100644 --- a/sound/hda/hdac_regmap.c +++ b/sound/hda/hdac_regmap.c @@ -363,6 +363,7 @@ static const struct regmap_config hda_regmap_cfg = { .reg_write = hda_reg_write, .use_single_read = true, .use_single_write = true, + .disable_locking = true, }; /** @@ -425,12 +426,29 @@ EXPORT_SYMBOL_GPL(snd_hdac_regmap_add_vendor_verb); static int reg_raw_write(struct hdac_device *codec, unsigned int reg, unsigned int val) { + int err; + + mutex_lock(&codec->regmap_lock); if (!codec->regmap) - return hda_reg_write(codec, reg, val); + err = hda_reg_write(codec, reg, val); else - return regmap_write(codec->regmap, reg, val); + err = regmap_write(codec->regmap, reg, val); + mutex_unlock(&codec->regmap_lock); + return err; } +/* a helper macro to call @func_call; retry with power-up if failed */ +#define CALL_RAW_FUNC(codec, func_call) \ + ({ \ + int _err = func_call; \ + if (_err == -EAGAIN) { \ + _err = snd_hdac_power_up_pm(codec); \ + if (_err >= 0) \ + _err = func_call; \ + snd_hdac_power_down_pm(codec); \ + } \ + _err;}) + /** * snd_hdac_regmap_write_raw - write a pseudo register with power mgmt * @codec: the codec object @@ -442,42 +460,29 @@ static int reg_raw_write(struct hdac_device *codec, unsigned int reg, int snd_hdac_regmap_write_raw(struct hdac_device *codec, unsigned int reg, unsigned int val) { - int err; - - err = reg_raw_write(codec, reg, val); - if (err == -EAGAIN) { - err = snd_hdac_power_up_pm(codec); - if (err >= 0) - err = reg_raw_write(codec, reg, val); - snd_hdac_power_down_pm(codec); - } - return err; + return CALL_RAW_FUNC(codec, reg_raw_write(codec, reg, val)); } EXPORT_SYMBOL_GPL(snd_hdac_regmap_write_raw); static int reg_raw_read(struct hdac_device *codec, unsigned int reg, unsigned int *val, bool uncached) { + int err; + + mutex_lock(&codec->regmap_lock); if (uncached || !codec->regmap) - return hda_reg_read(codec, reg, val); + err = hda_reg_read(codec, reg, val); else - return regmap_read(codec->regmap, reg, val); + err = regmap_read(codec->regmap, reg, val); + mutex_unlock(&codec->regmap_lock); + return err; } static int __snd_hdac_regmap_read_raw(struct hdac_device *codec, unsigned int reg, unsigned int *val, bool uncached) { - int err; - - err = reg_raw_read(codec, reg, val, uncached); - if (err == -EAGAIN) { - err = snd_hdac_power_up_pm(codec); - if (err >= 0) - err = reg_raw_read(codec, reg, val, uncached); - snd_hdac_power_down_pm(codec); - } - return err; + return CALL_RAW_FUNC(codec, reg_raw_read(codec, reg, val, uncached)); } /** @@ -504,11 +509,40 @@ int snd_hdac_regmap_read_raw_uncached(struct hdac_device *codec, return __snd_hdac_regmap_read_raw(codec, reg, val, true); } +static int reg_raw_update(struct hdac_device *codec, unsigned int reg, + unsigned int mask, unsigned int val) +{ + unsigned int orig; + bool change; + int err; + + mutex_lock(&codec->regmap_lock); + if (codec->regmap) { + err = regmap_update_bits_check(codec->regmap, reg, mask, val, + &change); + if (!err) + err = change ? 1 : 0; + } else { + err = hda_reg_read(codec, reg, &orig); + if (!err) { + val &= mask; + val |= orig & ~mask; + if (val != orig) { + err = hda_reg_write(codec, reg, val); + if (!err) + err = 1; + } + } + } + mutex_unlock(&codec->regmap_lock); + return err; +} + /** * snd_hdac_regmap_update_raw - update a pseudo register with power mgmt * @codec: the codec object * @reg: pseudo register - * @mask: bit mask to udpate + * @mask: bit mask to update * @val: value to update * * Returns zero if successful or a negative error code. @@ -516,19 +550,57 @@ int snd_hdac_regmap_read_raw_uncached(struct hdac_device *codec, int snd_hdac_regmap_update_raw(struct hdac_device *codec, unsigned int reg, unsigned int mask, unsigned int val) { + return CALL_RAW_FUNC(codec, reg_raw_update(codec, reg, mask, val)); +} +EXPORT_SYMBOL_GPL(snd_hdac_regmap_update_raw); + +static int reg_raw_update_once(struct hdac_device *codec, unsigned int reg, + unsigned int mask, unsigned int val) +{ unsigned int orig; int err; - val &= mask; - err = snd_hdac_regmap_read_raw(codec, reg, &orig); - if (err < 0) - return err; - val |= orig & ~mask; - if (val == orig) - return 0; - err = snd_hdac_regmap_write_raw(codec, reg, val); + if (!codec->regmap) + return reg_raw_update(codec, reg, mask, val); + + mutex_lock(&codec->regmap_lock); + regcache_cache_only(codec->regmap, true); + err = regmap_read(codec->regmap, reg, &orig); + regcache_cache_only(codec->regmap, false); if (err < 0) - return err; - return 1; + err = regmap_update_bits(codec->regmap, reg, mask, val); + mutex_unlock(&codec->regmap_lock); + return err; } -EXPORT_SYMBOL_GPL(snd_hdac_regmap_update_raw); + +/** + * snd_hdac_regmap_update_raw_once - initialize the register value only once + * @codec: the codec object + * @reg: pseudo register + * @mask: bit mask to update + * @val: value to update + * + * Performs the update of the register bits only once when the register + * hasn't been initialized yet. Used in HD-audio legacy driver. + * Returns zero if successful or a negative error code + */ +int snd_hdac_regmap_update_raw_once(struct hdac_device *codec, unsigned int reg, + unsigned int mask, unsigned int val) +{ + return CALL_RAW_FUNC(codec, reg_raw_update_once(codec, reg, mask, val)); +} +EXPORT_SYMBOL_GPL(snd_hdac_regmap_update_raw_once); + +/** + * snd_hdac_regmap_sync - sync out the cached values for PM resume + * @codec: the codec object + */ +void snd_hdac_regmap_sync(struct hdac_device *codec) +{ + if (codec->regmap) { + mutex_lock(&codec->regmap_lock); + regcache_sync(codec->regmap); + mutex_unlock(&codec->regmap_lock); + } +} +EXPORT_SYMBOL_GPL(snd_hdac_regmap_sync); diff --git a/sound/hda/hdac_stream.c b/sound/hda/hdac_stream.c index 682ed39f79b0..d01e69139164 100644 --- a/sound/hda/hdac_stream.c +++ b/sound/hda/hdac_stream.c @@ -590,7 +590,9 @@ EXPORT_SYMBOL_GPL(snd_hdac_stream_timecounter_init); /** * snd_hdac_stream_sync_trigger - turn on/off stream sync register * @azx_dev: HD-audio core stream (master stream) + * @set: true = set, false = clear * @streams: bit flags of streams to sync + * @reg: the stream sync register address */ void snd_hdac_stream_sync_trigger(struct hdac_stream *azx_dev, bool set, unsigned int streams, unsigned int reg) diff --git a/sound/hda/hdmi_chmap.c b/sound/hda/hdmi_chmap.c index 886cb7811bd6..5fd6d575e123 100644 --- a/sound/hda/hdmi_chmap.c +++ b/sound/hda/hdmi_chmap.c @@ -59,7 +59,7 @@ static const char * const cea_speaker_allocation_names[] = { /* * ELD SA bits in the CEA Speaker Allocation data block */ -static int eld_speaker_allocation_bits[] = { +static const int eld_speaker_allocation_bits[] = { [0] = FL | FR, [1] = LFE, [2] = FC, diff --git a/sound/hda/intel-nhlt.c b/sound/hda/intel-nhlt.c index 097ff6c10099..99a23fe7fab9 100644 --- a/sound/hda/intel-nhlt.c +++ b/sound/hda/intel-nhlt.c @@ -7,7 +7,7 @@ #define NHLT_ACPI_HEADER_SIG "NHLT" /* Unique identification for getting NHLT blobs */ -static guid_t osc_guid = +static const guid_t osc_guid = GUID_INIT(0xA69F886E, 0x6CEB, 0x4594, 0xA4, 0x1F, 0x7B, 0x5D, 0xCE, 0x24, 0xC5, 0x53); |