aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1/board-nokia770.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2006-12-07 16:58:17 -0500
committerTony Lindgren <tony@atomide.com>2007-09-20 21:34:50 -0400
commita524626b113e36fc70cb456449444018e3045d5f (patch)
tree90307a026ae10a96d214d8822d363e2452df7d72 /arch/arm/mach-omap1/board-nokia770.c
parentc79ed1940ca9a4af5e9c182ac51f28dadd32956d (diff)
ARM: OMAP: Sync board specific files with linux-omap
This patch syncs omap board specific files with linux-omap tree. Patch consists mostly of driver updates done in linux-omap tree for drivers not yet in mainline kernel. Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap1/board-nokia770.c')
-rw-r--r--arch/arm/mach-omap1/board-nokia770.c53
1 files changed, 44 insertions, 9 deletions
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index 70014f751bc4..8ea0cef8bdb1 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -34,6 +34,8 @@
34#include <asm/arch/aic23.h> 34#include <asm/arch/aic23.h>
35#include <asm/arch/gpio.h> 35#include <asm/arch/gpio.h>
36 36
37#include "../plat-omap/dsp/dsp_common.h"
38
37static void __init omap_nokia770_init_irq(void) 39static void __init omap_nokia770_init_irq(void)
38{ 40{
39 /* On Nokia 770, the SleepX signal is masked with an 41 /* On Nokia 770, the SleepX signal is masked with an
@@ -91,7 +93,7 @@ static struct platform_device nokia770_kp_device = {
91}; 93};
92 94
93static struct platform_device *nokia770_devices[] __initdata = { 95static struct platform_device *nokia770_devices[] __initdata = {
94 &nokia770_kp_device, 96 &nokia770_kp_device,
95}; 97};
96 98
97static struct ads7846_platform_data nokia770_ads7846_platform_data __initdata = { 99static struct ads7846_platform_data nokia770_ads7846_platform_data __initdata = {
@@ -105,7 +107,7 @@ static struct ads7846_platform_data nokia770_ads7846_platform_data __initdata =
105 107
106static struct spi_board_info nokia770_spi_board_info[] __initdata = { 108static struct spi_board_info nokia770_spi_board_info[] __initdata = {
107 [0] = { 109 [0] = {
108 .modalias = "lcd_mipid", 110 .modalias = "lcd_mipid",
109 .bus_num = 2, 111 .bus_num = 2,
110 .chip_select = 3, 112 .chip_select = 3,
111 .max_speed_hz = 12000000, 113 .max_speed_hz = 12000000,
@@ -153,6 +155,7 @@ static struct omap_board_config_kernel nokia770_config[] = {
153 { OMAP_TAG_MMC, &nokia770_mmc_config }, 155 { OMAP_TAG_MMC, &nokia770_mmc_config },
154}; 156};
155 157
158#if defined(CONFIG_OMAP_DSP)
156/* 159/*
157 * audio power control 160 * audio power control
158 */ 161 */
@@ -183,7 +186,7 @@ static void nokia770_audio_pwr_up(void)
183 clk_enable(dspxor_ck); 186 clk_enable(dspxor_ck);
184 187
185 /* Turn on codec */ 188 /* Turn on codec */
186 tlv320aic23_power_up(); 189 aic23_power_up();
187 190
188 if (omap_get_gpio_datain(HEADPHONE_GPIO)) 191 if (omap_get_gpio_datain(HEADPHONE_GPIO))
189 /* HP not connected, turn on amplifier */ 192 /* HP not connected, turn on amplifier */
@@ -197,7 +200,7 @@ static void codec_delayed_power_down(struct work_struct *work)
197{ 200{
198 down(&audio_pwr_sem); 201 down(&audio_pwr_sem);
199 if (audio_pwr_state == -1) 202 if (audio_pwr_state == -1)
200 tlv320aic23_power_down(); 203 aic23_power_down();
201 clk_disable(dspxor_ck); 204 clk_disable(dspxor_ck);
202 up(&audio_pwr_sem); 205 up(&audio_pwr_sem);
203} 206}
@@ -213,7 +216,8 @@ static void nokia770_audio_pwr_down(void)
213 schedule_delayed_work(&codec_power_down_work, HZ / 20); /* 50ms */ 216 schedule_delayed_work(&codec_power_down_work, HZ / 20); /* 50ms */
214} 217}
215 218
216void nokia770_audio_pwr_up_request(int stage) 219static int
220nokia770_audio_pwr_up_request(struct dsp_kfunc_device *kdev, int stage)
217{ 221{
218 down(&audio_pwr_sem); 222 down(&audio_pwr_sem);
219 if (audio_pwr_state == -1) 223 if (audio_pwr_state == -1)
@@ -221,9 +225,11 @@ void nokia770_audio_pwr_up_request(int stage)
221 /* force audio_pwr_state = 0, even if it was 1. */ 225 /* force audio_pwr_state = 0, even if it was 1. */
222 audio_pwr_state = 0; 226 audio_pwr_state = 0;
223 up(&audio_pwr_sem); 227 up(&audio_pwr_sem);
228 return 0;
224} 229}
225 230
226void nokia770_audio_pwr_down_request(int stage) 231static int
232nokia770_audio_pwr_down_request(struct dsp_kfunc_device *kdev, int stage)
227{ 233{
228 down(&audio_pwr_sem); 234 down(&audio_pwr_sem);
229 switch (stage) { 235 switch (stage) {
@@ -239,7 +245,38 @@ void nokia770_audio_pwr_down_request(int stage)
239 break; 245 break;
240 } 246 }
241 up(&audio_pwr_sem); 247 up(&audio_pwr_sem);
248 return 0;
249}
250
251static struct dsp_kfunc_device nokia770_audio_device = {
252 .name = "audio",
253 .type = DSP_KFUNC_DEV_TYPE_AUDIO,
254 .enable = nokia770_audio_pwr_up_request,
255 .disable = nokia770_audio_pwr_down_request,
256};
257
258static __init int omap_dsp_init(void)
259{
260 int ret;
261
262 dspxor_ck = clk_get(0, "dspxor_ck");
263 if (IS_ERR(dspxor_ck)) {
264 printk(KERN_ERR "couldn't acquire dspxor_ck\n");
265 return PTR_ERR(dspxor_ck);
266 }
267
268 ret = dsp_kfunc_device_register(&nokia770_audio_device);
269 if (ret) {
270 printk(KERN_ERR
271 "KFUNC device registration faild: %s\n",
272 nokia770_audio_device.name);
273 goto out;
274 }
275 return 0;
276 out:
277 return ret;
242} 278}
279#endif /* CONFIG_OMAP_DSP */
243 280
244static void __init omap_nokia770_init(void) 281static void __init omap_nokia770_init(void)
245{ 282{
@@ -251,9 +288,7 @@ static void __init omap_nokia770_init(void)
251 omap_board_config = nokia770_config; 288 omap_board_config = nokia770_config;
252 omap_board_config_size = ARRAY_SIZE(nokia770_config); 289 omap_board_config_size = ARRAY_SIZE(nokia770_config);
253 omap_serial_init(); 290 omap_serial_init();
254 omap_dsp_audio_pwr_up_request = nokia770_audio_pwr_up_request; 291 omap_dsp_init();
255 omap_dsp_audio_pwr_down_request = nokia770_audio_pwr_down_request;
256 dspxor_ck = clk_get(0, "dspxor_ck");
257} 292}
258 293
259static void __init omap_nokia770_map_io(void) 294static void __init omap_nokia770_map_io(void)