From: Vinod Koul <vinod.koul@intel.com>
To: alsa-devel@alsa-project.org
Cc: liam.r.girdwood@linux.intel.com, tiwai@suse.de,
broonie@kernel.org, Vinod Koul <vinod.koul@intel.com>,
patches.audio@intel.com
Subject: [PATCH 15/18] ALSA: hda: move patch_sigmatel to use hdac helpers
Date: Tue, 6 Oct 2015 16:07:52 +0100 [thread overview]
Message-ID: <1444144075-28963-16-git-send-email-vinod.koul@intel.com> (raw)
In-Reply-To: <1444144075-28963-1-git-send-email-vinod.koul@intel.com>
Move patch_sigmatel to use newly moved snd_hdac_read/write_codec()
APIs
This was done using coccinelle script
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
sound/pci/hda/patch_sigmatel.c | 78 +++++++++++++++++++++---------------------
1 file changed, 39 insertions(+), 39 deletions(-)
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 9d947aef2c8b..0fc42761a5d2 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -279,13 +279,13 @@ static void stac_capture_pcm_hook(struct hda_pcm_stream *hinfo,
switch (action) {
case HDA_GEN_PCM_ACT_OPEN:
msleep(40);
- snd_hda_codec_write(codec, hinfo->nid, 0,
- AC_VERB_SET_POWER_STATE, AC_PWRST_D0);
+ snd_hdac_codec_write(&codec->core, hinfo->nid, 0,
+ AC_VERB_SET_POWER_STATE, AC_PWRST_D0);
spec->active_adcs |= (1 << idx);
break;
case HDA_GEN_PCM_ACT_CLOSE:
- snd_hda_codec_write(codec, hinfo->nid, 0,
- AC_VERB_SET_POWER_STATE, AC_PWRST_D3);
+ snd_hdac_codec_write(&codec->core, hinfo->nid, 0,
+ AC_VERB_SET_POWER_STATE, AC_PWRST_D3);
spec->active_adcs &= ~(1 << idx);
break;
}
@@ -304,30 +304,30 @@ static void stac_gpio_set(struct hda_codec *codec, unsigned int mask,
codec_dbg(codec, "%s msk %x dir %x gpio %x\n", __func__, mask, dir_mask, data);
- gpiostate = snd_hda_codec_read(codec, fg, 0,
- AC_VERB_GET_GPIO_DATA, 0);
+ gpiostate = snd_hdac_codec_read(&codec->core, fg, 0,
+ AC_VERB_GET_GPIO_DATA, 0);
gpiostate = (gpiostate & ~dir_mask) | (data & dir_mask);
- gpiomask = snd_hda_codec_read(codec, fg, 0,
- AC_VERB_GET_GPIO_MASK, 0);
+ gpiomask = snd_hdac_codec_read(&codec->core, fg, 0,
+ AC_VERB_GET_GPIO_MASK, 0);
gpiomask |= mask;
- gpiodir = snd_hda_codec_read(codec, fg, 0,
- AC_VERB_GET_GPIO_DIRECTION, 0);
+ gpiodir = snd_hdac_codec_read(&codec->core, fg, 0,
+ AC_VERB_GET_GPIO_DIRECTION, 0);
gpiodir |= dir_mask;
/* Configure GPIOx as CMOS */
- snd_hda_codec_write(codec, fg, 0, 0x7e7, 0);
+ snd_hdac_codec_write(&codec->core, fg, 0, 0x7e7, 0);
- snd_hda_codec_write(codec, fg, 0,
- AC_VERB_SET_GPIO_MASK, gpiomask);
- snd_hda_codec_read(codec, fg, 0,
- AC_VERB_SET_GPIO_DIRECTION, gpiodir); /* sync */
+ snd_hdac_codec_write(&codec->core, fg, 0, AC_VERB_SET_GPIO_MASK,
+ gpiomask);
+ snd_hdac_codec_read(&codec->core, fg, 0, AC_VERB_SET_GPIO_DIRECTION,
+ gpiodir); /* sync */
msleep(1);
- snd_hda_codec_read(codec, fg, 0,
- AC_VERB_SET_GPIO_DATA, gpiostate); /* sync */
+ snd_hdac_codec_read(&codec->core, fg, 0, AC_VERB_SET_GPIO_DATA,
+ gpiostate); /* sync */
}
/* hook for controlling mic-mute LED GPIO */
@@ -366,8 +366,8 @@ static int stac_vrefout_set(struct hda_codec *codec,
int error, pinctl;
codec_dbg(codec, "%s, nid %x ctl %x\n", __func__, nid, new_vref);
- pinctl = snd_hda_codec_read(codec, nid, 0,
- AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
+ pinctl = snd_hdac_codec_read(&codec->core, nid, 0,
+ AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
if (pinctl < 0)
return pinctl;
@@ -434,7 +434,7 @@ static void stac_update_outputs(struct hda_codec *codec)
if (spec->gpio_mute)
spec->gen.master_mute =
- !(snd_hda_codec_read(codec, codec->core.afg, 0,
+ !(snd_hdac_codec_read(&codec->core, codec->core.afg, 0,
AC_VERB_GET_GPIO_DATA, 0) & spec->gpio_mute);
snd_hda_gen_update_outputs(codec);
@@ -478,8 +478,8 @@ static void stac_toggle_power_map(struct hda_codec *codec, hda_nid_t nid,
if (val != spec->power_map_bits) {
spec->power_map_bits = val;
if (do_write)
- snd_hda_codec_write(codec, codec->core.afg, 0,
- AC_VERB_IDT_SET_POWER_MAP, val);
+ snd_hdac_codec_write(&codec->core, codec->core.afg, 0,
+ AC_VERB_IDT_SET_POWER_MAP, val);
}
}
@@ -510,9 +510,8 @@ static void jack_update_power(struct hda_codec *codec,
false);
}
- snd_hda_codec_write(codec, codec->core.afg, 0,
- AC_VERB_IDT_SET_POWER_MAP,
- spec->power_map_bits);
+ snd_hdac_codec_write(&codec->core, codec->core.afg, 0,
+ AC_VERB_IDT_SET_POWER_MAP, spec->power_map_bits);
}
static void stac_vref_event(struct hda_codec *codec,
@@ -520,11 +519,11 @@ static void stac_vref_event(struct hda_codec *codec,
{
unsigned int data;
- data = snd_hda_codec_read(codec, codec->core.afg, 0,
- AC_VERB_GET_GPIO_DATA, 0);
+ data = snd_hdac_codec_read(&codec->core, codec->core.afg, 0,
+ AC_VERB_GET_GPIO_DATA, 0);
/* toggle VREF state based on GPIOx status */
- snd_hda_codec_write(codec, codec->core.afg, 0, 0x7e0,
- !!(data & (1 << event->private_data)));
+ snd_hdac_codec_write(&codec->core, codec->core.afg, 0, 0x7e0,
+ !!(data & (1 << event->private_data)));
}
/* initialize the power map and enable the power event to jacks that
@@ -625,8 +624,8 @@ static int stac_aloopback_put(struct snd_kcontrol *kcontrol,
/* Only return the bits defined by the shift value of the
* first two bytes of the mask
*/
- dac_mode = snd_hda_codec_read(codec, codec->core.afg, 0,
- kcontrol->private_value & 0xFFFF, 0x0);
+ dac_mode = snd_hdac_codec_read(&codec->core, codec->core.afg, 0,
+ kcontrol->private_value & 0xFFFF, 0x0);
dac_mode >>= spec->aloopback_shift;
if (spec->aloopback & idx_val) {
@@ -4331,18 +4330,19 @@ static int stac_init(struct hda_codec *codec)
/* sync the power-map */
if (spec->num_pwrs)
- snd_hda_codec_write(codec, codec->core.afg, 0,
- AC_VERB_IDT_SET_POWER_MAP,
- spec->power_map_bits);
+ snd_hdac_codec_write(&codec->core, codec->core.afg, 0,
+ AC_VERB_IDT_SET_POWER_MAP,
+ spec->power_map_bits);
/* power down inactive ADCs */
if (spec->powerdown_adcs) {
for (i = 0; i < spec->gen.num_all_adcs; i++) {
if (spec->active_adcs & (1 << i))
continue;
- snd_hda_codec_write(codec, spec->gen.all_adcs[i], 0,
- AC_VERB_SET_POWER_STATE,
- AC_PWRST_D3);
+ snd_hdac_codec_write(&codec->core,
+ spec->gen.all_adcs[i], 0,
+ AC_VERB_SET_POWER_STATE,
+ AC_PWRST_D3);
}
}
@@ -4369,7 +4369,7 @@ static void stac92hd_proc_hook(struct snd_info_buffer *buffer,
{
if (nid == codec->core.afg)
snd_iprintf(buffer, "Power-Map: 0x%02x\n",
- snd_hda_codec_read(codec, nid, 0,
+ snd_hdac_codec_read(&codec->core, nid, 0,
AC_VERB_IDT_GET_POWER_MAP, 0));
}
@@ -4378,7 +4378,7 @@ static void analog_loop_proc_hook(struct snd_info_buffer *buffer,
unsigned int verb)
{
snd_iprintf(buffer, "Analog Loopback: 0x%02x\n",
- snd_hda_codec_read(codec, codec->core.afg, 0, verb, 0));
+ snd_hdac_codec_read(&codec->core, codec->core.afg, 0, verb, 0));
}
/* stac92hd71bxx, stac92hd73xx */
--
2.4.3
next prev parent reply other threads:[~2015-10-06 15:09 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-06 15:07 [PATCH 00/18] ALSA: hdac: move hdac helpers to core Vinod Koul
2015-10-06 15:07 ` [PATCH 01/18] ALSA: hdac: Copy codec " Vinod Koul
2015-10-06 15:07 ` [PATCH 02/18] ALSA: hda: move hda beep to use hdac helpers Vinod Koul
2015-10-06 15:07 ` [PATCH 03/18] ALSA: hda: move hda_eld " Vinod Koul
2015-10-06 15:07 ` [PATCH 04/18] ALSA: hda: move hda_generic " Vinod Koul
2015-10-06 15:07 ` [PATCH 05/18] ALSA: hda: move hda_hwdep " Vinod Koul
2015-10-06 15:07 ` [PATCH 06/18] ALSA: hda: move hda_jack " Vinod Koul
2015-10-06 15:07 ` [PATCH 07/18] ALSA: hda: move hda_proc " Vinod Koul
2015-10-06 15:07 ` [PATCH 08/18] ALSA: hda: move patch_analog " Vinod Koul
2015-10-06 15:07 ` [PATCH 09/18] ALSA: hda: move patch_ca0132.c " Vinod Koul
2015-10-06 15:07 ` [PATCH 10/18] ALSA: hda: move patch_cirrus " Vinod Koul
2015-10-06 15:07 ` [PATCH 11/18] ALSA: hda: move " Vinod Koul
2015-10-06 15:07 ` [PATCH 12/18] ALSA: hda: move patch_hdmi " Vinod Koul
2015-10-06 15:07 ` [PATCH 13/18] ALSA: hda: move patch_realtek " Vinod Koul
2015-10-06 15:07 ` [PATCH 14/18] ALSA: hda: move patch_si3054 " Vinod Koul
2015-10-06 15:07 ` Vinod Koul [this message]
2015-10-06 15:07 ` [PATCH 16/18] ALSA: hda: move patch_via " Vinod Koul
2015-10-06 15:07 ` [PATCH 17/18] ALSA: hda: move hda_codec " Vinod Koul
2015-10-06 15:07 ` [PATCH 18/18] ALSA: hda: remove the old helpers Vinod Koul
2015-10-06 18:12 ` [PATCH 00/18] ALSA: hdac: move hdac helpers to core Takashi Iwai
2015-10-07 10:52 ` Koul, Vinod
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1444144075-28963-16-git-send-email-vinod.koul@intel.com \
--to=vinod.koul@intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=liam.r.girdwood@linux.intel.com \
--cc=patches.audio@intel.com \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).