diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-09-18 02:43:33 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-09-18 02:43:33 +0200 |
commit | 6ab8ad31601f29470eb895fd95e5c963e125aa1b (patch) | |
tree | 73327fe9fc2ee62e7815fa0a666fdf46aaab7322 /sound/hda/hdac_bus.c | |
parent | Merge tag 'mmc-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc (diff) | |
parent | Merge tag 'asoc-v5.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/broo... (diff) | |
download | linux-6ab8ad31601f29470eb895fd95e5c963e125aa1b.tar.xz linux-6ab8ad31601f29470eb895fd95e5c963e125aa1b.zip |
Merge tag 'sound-5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound updates from Takashi Iwai:
"As shown in diffstat and logs, it was again a busy development cycle
at this time, too. The most significant changes are still on-going
refactoring / modernization works for ASoC core and drivers, but there
are lots of other changes as well. Here we go, some highlights below:
ASoC:
- Quite a lot of cleanup / refactoring of ASoC core and APIs; most of
them are systematic, but also including cleanups and modernization
- A bulk of updates for some ASoC platforms, Freescale, sunxi and
Intel SST/SOF
- Initial support for Sound Open Firmware on i.MX8
- Removal of deprecated w90x900 and nuc900 drivers
- New support for Cirrus Logic CS47L15 and CS47L92, Freescale i.MX
7ULP and 8MQ, Meson G12A and NXP UDA1334
USB-audio:
- More validations of descriptor units for hardening against bugs
reported by fuzzers
- PCM device assignment workaround for a past call-order change
- Scarlett Gen2 mixer interface, a few more more quirks
HD-audio:
- Support for audio component with AMD/ATI and Nvidia HDMI codecs
- Clean up HD-audio core and remove indirect access ops for Intel SOF
- DMIC detection at probe; it would make systems automatically
falling back to SST/SOF driver on devices that need DMIC handling.
Needs a new Kconfig to set, and beware that it's still new and a
bit experimental
FireWire:
- Lots of code refactoring and cleanups"
* tag 'sound-5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (521 commits)
ASoC: sdm845: remove unneeded semicolon
ASoC: fsl_sai: Implement set_bclk_ratio
ASoC: dmaengine: Replace strncpy() with strscpy_pad() for pcm->name
ASoC: wcd9335: remove redundant use of ret variable
ALSA: firewire-tascam: check intermediate state of clock status and retry
ALSA: firewire-tascam: handle error code when getting current source of clock
ASoC: hdmi-codec: Add an op to set callback function for plug event
ASoC: rt5677: keep analog power register at SND_SOC_BIAS_OFF
ASoC: rt5677: Remove magic number register writes
ASoC: soc-core: self contained soc_unbind_aux_dev()
ASoC: soc-core: add soc_unbind_aux_dev()
ASoC: soc-core: self contained soc_bind_aux_dev()
ASoC: soc-core: move soc_probe_link_dais() next to soc_remove_link_dais()
ASoC: soc-core: self contained soc_probe_link_dais()
ASoC: soc-core: add new soc_link_init()
ASoC: soc-core: move soc_probe_dai() next to soc_remove_dai()
ASoC: soc-core: self contained soc_remove_link_dais()
ASoC: soc-core: self contained soc_remove_link_components()
ASoC: soc-core: self contained soc_probe_link_components()
ASoC: rt1308: make array pd static const, makes object smaller
...
Diffstat (limited to 'sound/hda/hdac_bus.c')
-rw-r--r-- | sound/hda/hdac_bus.c | 45 |
1 files changed, 37 insertions, 8 deletions
diff --git a/sound/hda/hdac_bus.c b/sound/hda/hdac_bus.c index 14e57ffd5bc1..8f19876244eb 100644 --- a/sound/hda/hdac_bus.c +++ b/sound/hda/hdac_bus.c @@ -4,12 +4,16 @@ */ #include <linux/init.h> +#include <linux/io.h> #include <linux/device.h> #include <linux/module.h> #include <linux/export.h> #include <sound/hdaudio.h> +#include "local.h" #include "trace.h" +static void snd_hdac_bus_process_unsol_events(struct work_struct *work); + static const struct hdac_bus_ops default_ops = { .command = snd_hdac_bus_send_cmd, .get_response = snd_hdac_bus_get_response, @@ -19,13 +23,11 @@ static const struct hdac_bus_ops default_ops = { * snd_hdac_bus_init - initialize a HD-audio bas bus * @bus: the pointer to bus object * @ops: bus verb operators - * @io_ops: lowlevel I/O operators * * Returns 0 if successful, or a negative error code. */ int snd_hdac_bus_init(struct hdac_bus *bus, struct device *dev, - const struct hdac_bus_ops *ops, - const struct hdac_io_ops *io_ops) + const struct hdac_bus_ops *ops) { memset(bus, 0, sizeof(*bus)); bus->dev = dev; @@ -33,7 +35,7 @@ int snd_hdac_bus_init(struct hdac_bus *bus, struct device *dev, bus->ops = ops; else bus->ops = &default_ops; - bus->io_ops = io_ops; + bus->dma_type = SNDRV_DMA_TYPE_DEV; INIT_LIST_HEAD(&bus->stream_list); INIT_LIST_HEAD(&bus->codec_list); INIT_WORK(&bus->unsol_work, snd_hdac_bus_process_unsol_events); @@ -149,7 +151,7 @@ EXPORT_SYMBOL_GPL(snd_hdac_bus_queue_event); /* * process queued unsolicited events */ -void snd_hdac_bus_process_unsol_events(struct work_struct *work) +static void snd_hdac_bus_process_unsol_events(struct work_struct *work) { struct hdac_bus *bus = container_of(work, struct hdac_bus, unsol_work); struct hdac_device *codec; @@ -172,7 +174,6 @@ void snd_hdac_bus_process_unsol_events(struct work_struct *work) drv->unsol_event(codec, res); } } -EXPORT_SYMBOL_GPL(snd_hdac_bus_process_unsol_events); /** * snd_hdac_bus_add_device - Add a codec to bus @@ -197,7 +198,6 @@ int snd_hdac_bus_add_device(struct hdac_bus *bus, struct hdac_device *codec) bus->num_codecs++; return 0; } -EXPORT_SYMBOL_GPL(snd_hdac_bus_add_device); /** * snd_hdac_bus_remove_device - Remove a codec from bus @@ -216,4 +216,33 @@ void snd_hdac_bus_remove_device(struct hdac_bus *bus, bus->num_codecs--; flush_work(&bus->unsol_work); } -EXPORT_SYMBOL_GPL(snd_hdac_bus_remove_device); + +#ifdef CONFIG_SND_HDA_ALIGNED_MMIO +/* Helpers for aligned read/write of mmio space, for Tegra */ +unsigned int snd_hdac_aligned_read(void __iomem *addr, unsigned int mask) +{ + void __iomem *aligned_addr = + (void __iomem *)((unsigned long)(addr) & ~0x3); + unsigned int shift = ((unsigned long)(addr) & 0x3) << 3; + unsigned int v; + + v = readl(aligned_addr); + return (v >> shift) & mask; +} +EXPORT_SYMBOL_GPL(snd_hdac_aligned_read); + +void snd_hdac_aligned_write(unsigned int val, void __iomem *addr, + unsigned int mask) +{ + void __iomem *aligned_addr = + (void __iomem *)((unsigned long)(addr) & ~0x3); + unsigned int shift = ((unsigned long)(addr) & 0x3) << 3; + unsigned int v; + + v = readl(aligned_addr); + v &= ~(mask << shift); + v |= val << shift; + writel(v, aligned_addr); +} +EXPORT_SYMBOL_GPL(snd_hdac_aligned_write); +#endif /* CONFIG_SND_HDA_ALIGNED_MMIO */ |