summaryrefslogtreecommitdiff
path: root/sound/pci/oxygen/hifier.c
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2008-05-13 11:22:43 +0400
committerJaroslav Kysela <perex@perex.cz>2008-05-19 15:19:17 +0400
commit75146fc0f9368ea41419792ac8bfdd19273b4473 (patch)
tree73d3280052d0a1e63a38c3eaf42fe80cbd616a0c /sound/pci/oxygen/hifier.c
parentbbbfb5526650cb9d01c5c230a4e3cbbc18474c41 (diff)
downloadlinux-75146fc0f9368ea41419792ac8bfdd19273b4473.tar.xz
[ALSA] oxygen: separate out hardware initialization code
Create separate functions for the code that initializes the hardware, as opposed to initializing internal driver state, so that they can be reused for resume support. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/pci/oxygen/hifier.c')
-rw-r--r--sound/pci/oxygen/hifier.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sound/pci/oxygen/hifier.c b/sound/pci/oxygen/hifier.c
index 0e425d554505..6e45a58ad14b 100644
--- a/sound/pci/oxygen/hifier.c
+++ b/sound/pci/oxygen/hifier.c
@@ -68,15 +68,22 @@ static void update_ak4396_volume(struct oxygen *chip)
ak4396_write(chip, AK4396_RCH_ATT, chip->dac_volume[1]);
}
-static void hifier_init(struct oxygen *chip)
+static void hifier_registers_init(struct oxygen *chip)
{
struct hifier_data *data = chip->model_data;
- data->ak4396_ctl2 = AK4396_SMUTE | AK4396_DEM_OFF | AK4396_DFS_NORMAL;
ak4396_write(chip, AK4396_CONTROL_1, AK4396_DIF_24_MSB | AK4396_RSTN);
ak4396_write(chip, AK4396_CONTROL_2, data->ak4396_ctl2);
ak4396_write(chip, AK4396_CONTROL_3, AK4396_PCM);
update_ak4396_volume(chip);
+}
+
+static void hifier_init(struct oxygen *chip)
+{
+ struct hifier_data *data = chip->model_data;
+
+ data->ak4396_ctl2 = AK4396_SMUTE | AK4396_DEM_OFF | AK4396_DFS_NORMAL;
+ hifier_registers_init(chip);
snd_component_add(chip->card, "AK4396");
snd_component_add(chip->card, "CS5340");