Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions arch/arm64/configs/deepin_arm64_desktop_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3267,6 +3267,7 @@ CONFIG_SND_VX222=m
CONFIG_SND_YMFPCI=m
CONFIG_SND_HDA_INTEL=y
CONFIG_SND_HDA_PHYTIUM=m
CONFIG_SND_HDA_CIX_IPBLOQ=m
CONFIG_SND_HDA_HWDEP=y
CONFIG_SND_HDA_INPUT_BEEP=y
CONFIG_SND_HDA_PATCH_LOADER=y
Expand Down Expand Up @@ -3310,8 +3311,6 @@ CONFIG_SND_ATMEL_SOC=m
CONFIG_SND_SOC_CIX=m
CONFIG_SND_SOC_CDNS_I2S_SC_CIX=m
CONFIG_SND_SOC_CDNS_I2S_MC_CIX=m
CONFIG_SND_SOC_IPBLOQ_HDA_CIX=m
CONFIG_SND_HDACODEC_REALTEK_CIX=m
CONFIG_SND_DESIGNWARE_I2S=m
CONFIG_SND_DESIGNWARE_PCM=y
CONFIG_SND_SOC_FSL_ASRC=m
Expand Down
3 changes: 3 additions & 0 deletions drivers/soc/cix/acpi/acpi_resource_lookup.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,11 @@ static int reset_lookup_handle(const union acpi_object *obj, void *data)

static int rmem_dev_set_dma(struct device *dev, phys_addr_t base, size_t size)
{
dev_err(dev, "==== dev[%s], dev->dma[%s]", dev ? "1": "NULL", dev->dma_mem ? "1": "NULL");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个日志信息级别不应该是dev_err 缩进有问题

if (!dev || dev->dma_mem)
return -EINVAL;
dev_err(dev, "==== memblock_is_region_memory[%d], memblock_is_map_memory[%d]",
memblock_is_region_memory(base, size), memblock_is_map_memory(base));

if (!memblock_is_region_memory(base, size)
|| memblock_is_map_memory(base))
Expand Down
1 change: 1 addition & 0 deletions include/sound/hda_codec.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ struct hda_codec {
unsigned int forced_resume:1; /* forced resume for jack */
unsigned int no_stream_clean_at_suspend:1; /* do not clean streams at suspend */
unsigned int ctl_dev_id:1; /* old control element id build behaviour */
unsigned int reconfig_init_verbs:1; /* need reconfig init verbs when system resume */

#ifdef CONFIG_PM
unsigned long power_on_acct;
Expand Down
6 changes: 6 additions & 0 deletions include/sound/hdaudio.h
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,12 @@ struct hdac_bus {
const struct hdac_bus_ops *ops;
const struct hdac_ext_bus_ops *ext_ops;

/* address translation from host to hdac */
dma_addr_t (*addr_host_to_hdac)(struct hdac_bus *bus, dma_addr_t addr);

/* configure init verbs */
int (*config_init_verbs)(struct hdac_bus *bus, unsigned int vendor_id);

/* h/w resources */
unsigned long addr;
void __iomem *remap_addr;
Expand Down
25 changes: 19 additions & 6 deletions sound/hda/hdac_controller.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,17 @@ static void azx_clear_corbrp(struct hdac_bus *bus)
void snd_hdac_bus_init_cmd_io(struct hdac_bus *bus)
{
WARN_ON_ONCE(!bus->rb.area);
dma_addr_t corb_addr, rirb_addr;

spin_lock_irq(&bus->reg_lock);
/* CORB set up */
bus->corb.addr = bus->rb.addr;
bus->corb.buf = (__le32 *)bus->rb.area;
snd_hdac_chip_writel(bus, CORBLBASE, (u32)bus->corb.addr);
snd_hdac_chip_writel(bus, CORBUBASE, upper_32_bits(bus->corb.addr));
corb_addr = bus->corb.addr;
if (bus->addr_host_to_hdac)
corb_addr = bus->addr_host_to_hdac(bus, bus->corb.addr);
snd_hdac_chip_writel(bus, CORBLBASE, (u32)corb_addr);
snd_hdac_chip_writel(bus, CORBUBASE, upper_32_bits(corb_addr));

/* set the corb size to 256 entries (ULI requires explicitly) */
snd_hdac_chip_writeb(bus, CORBSIZE, 0x02);
Expand All @@ -69,8 +73,11 @@ void snd_hdac_bus_init_cmd_io(struct hdac_bus *bus)
bus->rirb.buf = (__le32 *)(bus->rb.area + 2048);
bus->rirb.wp = bus->rirb.rp = 0;
memset(bus->rirb.cmds, 0, sizeof(bus->rirb.cmds));
snd_hdac_chip_writel(bus, RIRBLBASE, (u32)bus->rirb.addr);
snd_hdac_chip_writel(bus, RIRBUBASE, upper_32_bits(bus->rirb.addr));
rirb_addr = bus->rirb.addr;
if (bus->addr_host_to_hdac)
rirb_addr = bus->addr_host_to_hdac(bus, bus->rirb.addr);
snd_hdac_chip_writel(bus, RIRBLBASE, (u32)rirb_addr);
snd_hdac_chip_writel(bus, RIRBUBASE, upper_32_bits(rirb_addr));

/* set the rirb size to 256 entries (ULI requires explicitly) */
snd_hdac_chip_writeb(bus, RIRBSIZE, 0x02);
Expand Down Expand Up @@ -552,6 +559,8 @@ static void azx_int_clear(struct hdac_bus *bus)
*/
bool snd_hdac_bus_init_chip(struct hdac_bus *bus, bool full_reset)
{
dma_addr_t posbuf_addr;

if (bus->chip_init)
return false;

Expand All @@ -569,8 +578,12 @@ bool snd_hdac_bus_init_chip(struct hdac_bus *bus, bool full_reset)

/* program the position buffer */
if (bus->use_posbuf && bus->posbuf.addr) {
snd_hdac_chip_writel(bus, DPLBASE, (u32)bus->posbuf.addr);
snd_hdac_chip_writel(bus, DPUBASE, upper_32_bits(bus->posbuf.addr));
posbuf_addr = bus->posbuf.addr;
if (bus->addr_host_to_hdac)
posbuf_addr = bus->addr_host_to_hdac(bus, bus->posbuf.addr);

snd_hdac_chip_writel(bus, DPLBASE, (u32)posbuf_addr);
snd_hdac_chip_writel(bus, DPUBASE, upper_32_bits(posbuf_addr));
}

bus->chip_init = true;
Expand Down
1 change: 1 addition & 0 deletions sound/hda/hdac_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ int snd_hdac_device_init(struct hdac_device *codec, struct hdac_bus *bus,
dev->bus = &snd_hda_bus_type;
dev->release = default_release;
dev->groups = hdac_dev_attr_groups;
dev_set_uevent_suppress(dev, 1);
dev_set_name(dev, "%s", name);
device_enable_async_suspend(dev);

Expand Down
17 changes: 14 additions & 3 deletions sound/hda/hdac_stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ int snd_hdac_stream_setup(struct hdac_stream *azx_dev)
{
struct hdac_bus *bus = azx_dev->bus;
struct snd_pcm_runtime *runtime;
dma_addr_t bdl_addr, posbuf_addr;
unsigned int val;

if (azx_dev->substream)
Expand Down Expand Up @@ -305,17 +306,24 @@ int snd_hdac_stream_setup(struct hdac_stream *azx_dev)
snd_hdac_stream_writew(azx_dev, SD_LVI, azx_dev->frags - 1);

/* program the BDL address */
bdl_addr = azx_dev->bdl.addr;
if (bus->addr_host_to_hdac)
bdl_addr = bus->addr_host_to_hdac(bus, azx_dev->bdl.addr);
/* lower BDL address */
snd_hdac_stream_writel(azx_dev, SD_BDLPL, (u32)azx_dev->bdl.addr);
snd_hdac_stream_writel(azx_dev, SD_BDLPL, (u32)bdl_addr);
/* upper BDL address */
snd_hdac_stream_writel(azx_dev, SD_BDLPU,
upper_32_bits(azx_dev->bdl.addr));
upper_32_bits(bdl_addr));

/* enable the position buffer */
if (bus->use_posbuf && bus->posbuf.addr) {
posbuf_addr = bus->posbuf.addr;
if (bus->addr_host_to_hdac)
posbuf_addr = bus->addr_host_to_hdac(bus, bus->posbuf.addr);

if (!(snd_hdac_chip_readl(bus, DPLBASE) & AZX_DPLBASE_ENABLE))
snd_hdac_chip_writel(bus, DPLBASE,
(u32)bus->posbuf.addr | AZX_DPLBASE_ENABLE);
(u32)posbuf_addr| AZX_DPLBASE_ENABLE);
}

/* set the interrupt enable bits in the descriptor control register */
Expand Down Expand Up @@ -475,6 +483,9 @@ static int setup_bdle(struct hdac_bus *bus,
return -EINVAL;

addr = snd_sgbuf_get_addr(dmab, ofs);
if (bus->addr_host_to_hdac)
addr = bus->addr_host_to_hdac(bus, addr);

/* program the address field of the BDL entry */
bdl[0] = cpu_to_le32((u32)addr);
bdl[1] = cpu_to_le32(upper_32_bits(addr));
Expand Down
13 changes: 13 additions & 0 deletions sound/pci/hda/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,19 @@ config SND_HDA_TEGRA
To compile this driver as a module, choose M here: the module
will be called snd-hda-tegra.

config SND_HDA_CIX_IPBLOQ
tristate "CIX IPBLOQ HD Audio"
select SND_HDA
select SND_HDA_ALIGNED_MMIO
help
Say Y here to support the HDA controller present in CIX SoCs

This options enables support for the HD Audio controller
present in some CIX SoCs.

To compile this driver as a module, choose M here: the module
will be called snd-hda-cix-ipbloq.

if SND_HDA

config SND_HDA_HWDEP
Expand Down
2 changes: 2 additions & 0 deletions sound/pci/hda/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
snd-hda-intel-objs := hda_intel.o
snd-hda-tegra-objs := hda_tegra.o
snd-hda-phytium-objs := hda_phytium.o
snd-hda-cix-ipbloq-objs := hda_cix_ipbloq.o

snd-hda-codec-y := hda_bind.o hda_codec.o hda_jack.o hda_auto_parser.o hda_sysfs.o
snd-hda-codec-y += hda_controller.o
Expand Down Expand Up @@ -72,3 +73,4 @@ obj-$(CONFIG_SND_HDA_SCODEC_TAS2781_I2C) += snd-hda-scodec-tas2781-i2c.o
obj-$(CONFIG_SND_HDA_INTEL) += snd-hda-intel.o
obj-$(CONFIG_SND_HDA_TEGRA) += snd-hda-tegra.o
obj-$(CONFIG_SND_HDA_PHYTIUM) += snd-hda-phytium.o
obj-$(CONFIG_SND_HDA_CIX_IPBLOQ) += snd-hda-cix-ipbloq.o
Loading
Loading