diff options
author | Takashi Iwai <tiwai@suse.de> | 2015-04-14 17:26:00 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-04-16 07:31:48 +0200 |
commit | a43ff5baa55ff87268a67b45c6f6cb261c023db1 (patch) | |
tree | 74841b3cd338bfd81110df6931672a4e22747a0e /sound/pci/hda/hda_tegra.c | |
parent | ALSA: hda - Move send_cmd / get_response to hdac_bus_ops (diff) | |
download | linux-a43ff5baa55ff87268a67b45c6f6cb261c023db1.tar.xz linux-a43ff5baa55ff87268a67b45c6f6cb261c023db1.zip |
ALSA: hda - Pass bus io_ops directly from the top-level driver
One less redirection again. This also requires the change of the call
order in the toplevel divers. Namely, the bus has to be created at
first before other initializations since the memory allocation ops are
called through bus object now.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_tegra.c')
-rw-r--r-- | sound/pci/hda/hda_tegra.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/sound/pci/hda/hda_tegra.c b/sound/pci/hda/hda_tegra.c index 2e4fd5c56d3b..b150cb50961c 100644 --- a/sound/pci/hda/hda_tegra.c +++ b/sound/pci/hda/hda_tegra.c @@ -87,13 +87,13 @@ MODULE_PARM_DESC(power_save, /* * DMA page allocation ops. */ -static int dma_alloc_pages(struct azx *chip, int type, size_t size, +static int dma_alloc_pages(struct hdac_bus *bus, int type, size_t size, struct snd_dma_buffer *buf) { - return snd_dma_alloc_pages(type, chip->card->dev, size, buf); + return snd_dma_alloc_pages(type, bus->dev, size, buf); } -static void dma_free_pages(struct azx *chip, struct snd_dma_buffer *buf) +static void dma_free_pages(struct hdac_bus *bus, struct snd_dma_buffer *buf) { snd_dma_free_pages(buf); } @@ -173,7 +173,7 @@ static u8 hda_tegra_readb(u8 *addr) return (v >> shift) & 0xff; } -static const struct hda_controller_ops hda_tegra_ops = { +static const struct hdac_io_ops hda_tegra_io_ops = { .reg_writel = hda_tegra_writel, .reg_readl = hda_tegra_readl, .reg_writew = hda_tegra_writew, @@ -182,6 +182,9 @@ static const struct hda_controller_ops hda_tegra_ops = { .reg_readb = hda_tegra_readb, .dma_alloc_pages = dma_alloc_pages, .dma_free_pages = dma_free_pages, +}; + +static const struct hda_controller_ops hda_tegra_ops = { .substream_alloc_pages = substream_alloc_pages, .substream_free_pages = substream_free_pages, }; @@ -409,7 +412,6 @@ static int hda_tegra_first_init(struct azx *chip, struct platform_device *pdev) */ static int hda_tegra_create(struct snd_card *card, unsigned int driver_caps, - const struct hda_controller_ops *hda_ops, struct hda_tegra *hda) { static struct snd_device_ops ops = { @@ -423,7 +425,8 @@ static int hda_tegra_create(struct snd_card *card, spin_lock_init(&chip->reg_lock); mutex_init(&chip->open_mutex); chip->card = card; - chip->ops = hda_ops; + chip->ops = &hda_tegra_ops; + chip->io_ops = &hda_tegra_io_ops; chip->irq = -1; chip->driver_caps = driver_caps; chip->driver_type = driver_caps & 0xff; @@ -471,7 +474,11 @@ static int hda_tegra_probe(struct platform_device *pdev) return err; } - err = hda_tegra_create(card, driver_flags, &hda_tegra_ops, hda); + err = azx_bus_create(chip, NULL); + if (err < 0) + goto out_free; + + err = hda_tegra_create(card, driver_flags, hda); if (err < 0) goto out_free; card->private_data = chip; @@ -483,10 +490,6 @@ static int hda_tegra_probe(struct platform_device *pdev) goto out_free; /* create codec instances */ - err = azx_bus_create(chip, NULL); - if (err < 0) - goto out_free; - err = azx_probe_codecs(chip, 0); if (err < 0) goto out_free; |