diff options
Diffstat (limited to 'arch/sh/boards/mach-hp6xx/setup.c')
-rw-r--r-- | arch/sh/boards/mach-hp6xx/setup.c | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/arch/sh/boards/mach-hp6xx/setup.c b/arch/sh/boards/mach-hp6xx/setup.c index 8f305b36358b..e6dd5e96321e 100644 --- a/arch/sh/boards/mach-hp6xx/setup.c +++ b/arch/sh/boards/mach-hp6xx/setup.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/platform_device.h> | 14 | #include <linux/platform_device.h> |
15 | #include <linux/irq.h> | 15 | #include <linux/irq.h> |
16 | #include <sound/sh_dac_audio.h> | ||
16 | #include <asm/hd64461.h> | 17 | #include <asm/hd64461.h> |
17 | #include <asm/io.h> | 18 | #include <asm/io.h> |
18 | #include <mach/hp6xx.h> | 19 | #include <mach/hp6xx.h> |
@@ -51,9 +52,63 @@ static struct platform_device jornadakbd_device = { | |||
51 | .id = -1, | 52 | .id = -1, |
52 | }; | 53 | }; |
53 | 54 | ||
55 | static void dac_audio_start(struct dac_audio_pdata *pdata) | ||
56 | { | ||
57 | u16 v; | ||
58 | u8 v8; | ||
59 | |||
60 | /* HP Jornada 680/690 speaker on */ | ||
61 | v = inw(HD64461_GPADR); | ||
62 | v &= ~HD64461_GPADR_SPEAKER; | ||
63 | outw(v, HD64461_GPADR); | ||
64 | |||
65 | /* HP Palmtop 620lx/660lx speaker on */ | ||
66 | v8 = inb(PKDR); | ||
67 | v8 &= ~PKDR_SPEAKER; | ||
68 | outb(v8, PKDR); | ||
69 | |||
70 | sh_dac_enable(pdata->channel); | ||
71 | } | ||
72 | |||
73 | static void dac_audio_stop(struct dac_audio_pdata *pdata) | ||
74 | { | ||
75 | u16 v; | ||
76 | u8 v8; | ||
77 | |||
78 | /* HP Jornada 680/690 speaker off */ | ||
79 | v = inw(HD64461_GPADR); | ||
80 | v |= HD64461_GPADR_SPEAKER; | ||
81 | outw(v, HD64461_GPADR); | ||
82 | |||
83 | /* HP Palmtop 620lx/660lx speaker off */ | ||
84 | v8 = inb(PKDR); | ||
85 | v8 |= PKDR_SPEAKER; | ||
86 | outb(v8, PKDR); | ||
87 | |||
88 | sh_dac_output(0, pdata->channel); | ||
89 | sh_dac_disable(pdata->channel); | ||
90 | } | ||
91 | |||
92 | static struct dac_audio_pdata dac_audio_platform_data = { | ||
93 | .buffer_size = 64000, | ||
94 | .channel = 1, | ||
95 | .start = dac_audio_start, | ||
96 | .stop = dac_audio_stop, | ||
97 | }; | ||
98 | |||
99 | static struct platform_device dac_audio_device = { | ||
100 | .name = "dac_audio", | ||
101 | .id = -1, | ||
102 | .dev = { | ||
103 | .platform_data = &dac_audio_platform_data, | ||
104 | } | ||
105 | |||
106 | }; | ||
107 | |||
54 | static struct platform_device *hp6xx_devices[] __initdata = { | 108 | static struct platform_device *hp6xx_devices[] __initdata = { |
55 | &cf_ide_device, | 109 | &cf_ide_device, |
56 | &jornadakbd_device, | 110 | &jornadakbd_device, |
111 | &dac_audio_device, | ||
57 | }; | 112 | }; |
58 | 113 | ||
59 | static void __init hp6xx_init_irq(void) | 114 | static void __init hp6xx_init_irq(void) |