@@ -339,267 +339,6 @@ static struct omap_usb_config osk_usb_config __initdata = {
339339 .pins [0 ] = 2 ,
340340};
341341
342- #ifdef CONFIG_OMAP_OSK_MISTRAL
343- static const struct omap_lcd_config osk_lcd_config __initconst = {
344- .ctrl_name = "internal" ,
345- };
346- #endif
347-
348- #ifdef CONFIG_OMAP_OSK_MISTRAL
349-
350- #include <linux/input.h>
351- #include <linux/property.h>
352- #include <linux/spi/spi.h>
353- #include <linux/spi/ads7846.h>
354-
355- #include <linux/platform_data/keypad-omap.h>
356-
357- static const struct property_entry mistral_at24_properties [] = {
358- PROPERTY_ENTRY_U32 ("pagesize" , 16 ),
359- { }
360- };
361-
362- static const struct software_node mistral_at24_node = {
363- .properties = mistral_at24_properties ,
364- };
365-
366- static struct i2c_board_info __initdata mistral_i2c_board_info [] = {
367- {
368- /* NOTE: powered from LCD supply */
369- I2C_BOARD_INFO ("24c04" , 0x50 ),
370- .swnode = & mistral_at24_node ,
371- },
372- /* TODO when driver support is ready:
373- * - optionally ov9640 camera sensor at 0x30
374- */
375- };
376-
377- static const unsigned int osk_keymap [] = {
378- /* KEY(col, row, code) */
379- KEY (0 , 0 , KEY_F1 ), /* SW4 */
380- KEY (3 , 0 , KEY_UP ), /* (sw2/up) */
381- KEY (1 , 1 , KEY_LEFTCTRL ), /* SW5 */
382- KEY (2 , 1 , KEY_LEFT ), /* (sw2/left) */
383- KEY (0 , 2 , KEY_SPACE ), /* SW3 */
384- KEY (1 , 2 , KEY_ESC ), /* SW6 */
385- KEY (2 , 2 , KEY_DOWN ), /* (sw2/down) */
386- KEY (2 , 3 , KEY_ENTER ), /* (sw2/select) */
387- KEY (3 , 3 , KEY_RIGHT ), /* (sw2/right) */
388- };
389-
390- static const struct matrix_keymap_data osk_keymap_data = {
391- .keymap = osk_keymap ,
392- .keymap_size = ARRAY_SIZE (osk_keymap ),
393- };
394-
395- static struct omap_kp_platform_data osk_kp_data = {
396- .rows = 8 ,
397- .cols = 8 ,
398- .keymap_data = & osk_keymap_data ,
399- .delay = 9 ,
400- };
401-
402- static struct resource osk5912_kp_resources [] = {
403- [0 ] = {
404- .start = INT_KEYBOARD ,
405- .end = INT_KEYBOARD ,
406- .flags = IORESOURCE_IRQ ,
407- },
408- };
409-
410- static struct platform_device osk5912_kp_device = {
411- .name = "omap-keypad" ,
412- .id = -1 ,
413- .dev = {
414- .platform_data = & osk_kp_data ,
415- },
416- .num_resources = ARRAY_SIZE (osk5912_kp_resources ),
417- .resource = osk5912_kp_resources ,
418- };
419-
420- static struct omap_backlight_config mistral_bl_data = {
421- .default_intensity = 0xa0 ,
422- };
423-
424- static struct platform_device mistral_bl_device = {
425- .name = "omap-bl" ,
426- .id = -1 ,
427- .dev = {
428- .platform_data = & mistral_bl_data ,
429- },
430- };
431-
432- static struct platform_device osk5912_lcd_device = {
433- .name = "lcd_osk" ,
434- .id = -1 ,
435- };
436-
437- static const struct gpio_led mistral_gpio_led_pins [] = {
438- {
439- .name = "mistral:red" ,
440- .default_trigger = "heartbeat" ,
441- .gpio = 3 ,
442- },
443- {
444- .name = "mistral:green" ,
445- .default_trigger = "cpu0" ,
446- .gpio = OMAP_MPUIO (4 ),
447- },
448- };
449-
450- static struct gpio_led_platform_data mistral_gpio_led_data = {
451- .leds = mistral_gpio_led_pins ,
452- .num_leds = ARRAY_SIZE (mistral_gpio_led_pins ),
453- };
454-
455- static struct platform_device mistral_gpio_leds = {
456- .name = "leds-gpio" ,
457- .id = -1 ,
458- .dev = {
459- .platform_data = & mistral_gpio_led_data ,
460- },
461- };
462-
463- static struct platform_device * mistral_devices [] __initdata = {
464- & osk5912_kp_device ,
465- & mistral_bl_device ,
466- & osk5912_lcd_device ,
467- & mistral_gpio_leds ,
468- };
469-
470- static int mistral_get_pendown_state (void )
471- {
472- return !gpio_get_value (4 );
473- }
474-
475- static const struct ads7846_platform_data mistral_ts_info = {
476- .model = 7846 ,
477- .vref_delay_usecs = 100 , /* internal, no capacitor */
478- .x_plate_ohms = 419 ,
479- .y_plate_ohms = 486 ,
480- .get_pendown_state = mistral_get_pendown_state ,
481- };
482-
483- static struct spi_board_info __initdata mistral_boardinfo [] = { {
484- /* MicroWire (bus 2) CS0 has an ads7846e */
485- .modalias = "ads7846" ,
486- .platform_data = & mistral_ts_info ,
487- .max_speed_hz = 120000 /* max sample rate at 3V */
488- * 26 /* command + data + overhead */ ,
489- .bus_num = 2 ,
490- .chip_select = 0 ,
491- } };
492-
493- static irqreturn_t
494- osk_mistral_wake_interrupt (int irq , void * ignored )
495- {
496- return IRQ_HANDLED ;
497- }
498-
499- static void __init osk_mistral_init (void )
500- {
501- /* NOTE: we could actually tell if there's a Mistral board
502- * attached, e.g. by trying to read something from the ads7846.
503- * But this arch_init() code is too early for that, since we
504- * can't talk to the ads or even the i2c eeprom.
505- */
506-
507- /* parallel camera interface */
508- omap_cfg_reg (J15_1610_CAM_LCLK );
509- omap_cfg_reg (J18_1610_CAM_D7 );
510- omap_cfg_reg (J19_1610_CAM_D6 );
511- omap_cfg_reg (J14_1610_CAM_D5 );
512- omap_cfg_reg (K18_1610_CAM_D4 );
513- omap_cfg_reg (K19_1610_CAM_D3 );
514- omap_cfg_reg (K15_1610_CAM_D2 );
515- omap_cfg_reg (K14_1610_CAM_D1 );
516- omap_cfg_reg (L19_1610_CAM_D0 );
517- omap_cfg_reg (L18_1610_CAM_VS );
518- omap_cfg_reg (L15_1610_CAM_HS );
519- omap_cfg_reg (M19_1610_CAM_RSTZ );
520- omap_cfg_reg (Y15_1610_CAM_OUTCLK );
521-
522- /* serial camera interface */
523- omap_cfg_reg (H19_1610_CAM_EXCLK );
524- omap_cfg_reg (W13_1610_CCP_CLKM );
525- omap_cfg_reg (Y12_1610_CCP_CLKP );
526- /* CCP_DATAM CONFLICTS WITH UART1.TX (and serial console) */
527- /* omap_cfg_reg(Y14_1610_CCP_DATAM); */
528- omap_cfg_reg (W14_1610_CCP_DATAP );
529-
530- /* CAM_PWDN */
531- if (gpio_request (11 , "cam_pwdn" ) == 0 ) {
532- omap_cfg_reg (N20_1610_GPIO11 );
533- gpio_direction_output (11 , 0 );
534- } else
535- pr_debug ("OSK+Mistral: CAM_PWDN is awol\n" );
536-
537-
538- /* omap_cfg_reg(P19_1610_GPIO6); */ /* BUSY */
539- gpio_request (6 , "ts_busy" );
540- gpio_direction_input (6 );
541-
542- omap_cfg_reg (P20_1610_GPIO4 ); /* PENIRQ */
543- gpio_request (4 , "ts_int" );
544- gpio_direction_input (4 );
545- irq_set_irq_type (gpio_to_irq (4 ), IRQ_TYPE_EDGE_FALLING );
546-
547- mistral_boardinfo [0 ].irq = gpio_to_irq (4 );
548- spi_register_board_info (mistral_boardinfo ,
549- ARRAY_SIZE (mistral_boardinfo ));
550-
551- /* the sideways button (SW1) is for use as a "wakeup" button
552- *
553- * NOTE: The Mistral board has the wakeup button (SW1) wired
554- * to the LCD 3.3V rail, which is powered down during suspend.
555- * To allow this button to wake up the omap, work around this
556- * HW bug by rewiring SW1 to use the main 3.3V rail.
557- */
558- omap_cfg_reg (N15_1610_MPUIO2 );
559- if (gpio_request (OMAP_MPUIO (2 ), "wakeup" ) == 0 ) {
560- int ret = 0 ;
561- int irq = gpio_to_irq (OMAP_MPUIO (2 ));
562-
563- gpio_direction_input (OMAP_MPUIO (2 ));
564- irq_set_irq_type (irq , IRQ_TYPE_EDGE_RISING );
565- /* share the IRQ in case someone wants to use the
566- * button for more than wakeup from system sleep.
567- */
568- ret = request_irq (irq ,
569- & osk_mistral_wake_interrupt ,
570- IRQF_SHARED , "mistral_wakeup" ,
571- & osk_mistral_wake_interrupt );
572- if (ret != 0 ) {
573- gpio_free (OMAP_MPUIO (2 ));
574- printk (KERN_ERR "OSK+Mistral: no wakeup irq, %d?\n" ,
575- ret );
576- } else
577- enable_irq_wake (irq );
578- } else
579- printk (KERN_ERR "OSK+Mistral: wakeup button is awol\n" );
580-
581- /* LCD: backlight, and power; power controls other devices on the
582- * board, like the touchscreen, EEPROM, and wakeup (!) switch.
583- */
584- omap_cfg_reg (PWL );
585- if (gpio_request (2 , "lcd_pwr" ) == 0 )
586- gpio_direction_output (2 , 1 );
587-
588- /*
589- * GPIO based LEDs
590- */
591- omap_cfg_reg (P18_1610_GPIO3 );
592- omap_cfg_reg (MPUIO4 );
593-
594- i2c_register_board_info (1 , mistral_i2c_board_info ,
595- ARRAY_SIZE (mistral_i2c_board_info ));
596-
597- platform_add_devices (mistral_devices , ARRAY_SIZE (mistral_devices ));
598- }
599- #else
600- static void __init osk_mistral_init (void ) { }
601- #endif
602-
603342#define EMIFS_CS3_VAL (0x88013141)
604343
605344static void __init osk_init (void )
@@ -642,12 +381,6 @@ static void __init osk_init(void)
642381 osk_i2c_board_info [0 ].irq = gpio_to_irq (OMAP_MPUIO (1 ));
643382 omap_register_i2c_bus (1 , 400 , osk_i2c_board_info ,
644383 ARRAY_SIZE (osk_i2c_board_info ));
645- osk_mistral_init ();
646-
647- #ifdef CONFIG_OMAP_OSK_MISTRAL
648- omapfb_set_lcd_config (& osk_lcd_config );
649- #endif
650-
651384}
652385
653386MACHINE_START (OMAP_OSK , "TI-OSK" )
0 commit comments