aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1/board-osk.c
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2007-10-13 17:56:30 -0400
committerJean Delvare <khali@hyperion.delvare>2007-10-13 17:56:30 -0400
commit8056c6cb2bb1632aa9221dce0e43a61db37b420f (patch)
tree4ca321bba9db87c80c77f841c9a52c456be63aa5 /arch/arm/mach-omap1/board-osk.c
parentb5067f8ff37ed6cfa024170a9819bb09d55e9c1f (diff)
i2c/tps65010: New-style driver updates, part 2
Switch the tps65010 driver into a "new-style" I2C driver, and convert all of its in-tree users (board support for OSK, H2, H3) accordingly. That accounts for most of the board-specific code in this driver; the rest of that code is now moved into board-specific initcalls. Also remove some of the many now-superfluous #includes. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'arch/arm/mach-omap1/board-osk.c')
-rw-r--r--arch/arm/mach-omap1/board-osk.c64
1 files changed, 63 insertions, 1 deletions
diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c
index e7130293a03f..a61bf455ee02 100644
--- a/arch/arm/mach-omap1/board-osk.c
+++ b/arch/arm/mach-omap1/board-osk.c
@@ -31,18 +31,21 @@
31#include <linux/platform_device.h> 31#include <linux/platform_device.h>
32#include <linux/irq.h> 32#include <linux/irq.h>
33#include <linux/interrupt.h> 33#include <linux/interrupt.h>
34#include <linux/i2c.h>
34 35
35#include <linux/mtd/mtd.h> 36#include <linux/mtd/mtd.h>
36#include <linux/mtd/partitions.h> 37#include <linux/mtd/partitions.h>
37 38
38#include <asm/hardware.h> 39#include <asm/hardware.h>
40#include <asm/gpio.h>
41
39#include <asm/mach-types.h> 42#include <asm/mach-types.h>
40#include <asm/mach/arch.h> 43#include <asm/mach/arch.h>
41#include <asm/mach/map.h> 44#include <asm/mach/map.h>
42#include <asm/mach/flash.h> 45#include <asm/mach/flash.h>
43 46
44#include <asm/arch/gpio.h>
45#include <asm/arch/usb.h> 47#include <asm/arch/usb.h>
48#include <asm/arch/tps65010.h>
46#include <asm/arch/mux.h> 49#include <asm/arch/mux.h>
47#include <asm/arch/tc.h> 50#include <asm/arch/tc.h>
48#include <asm/arch/common.h> 51#include <asm/arch/common.h>
@@ -179,6 +182,19 @@ static struct platform_device *osk5912_devices[] __initdata = {
179 &osk5912_mcbsp1_device, 182 &osk5912_mcbsp1_device,
180}; 183};
181 184
185static struct i2c_board_info __initdata osk_i2c_board_info[] = {
186 {
187 I2C_BOARD_INFO("tps65010", 0x48),
188 .type = "tps65010",
189 .irq = OMAP_GPIO_IRQ(OMAP_MPUIO(1)),
190 },
191 /* TODO when driver support is ready:
192 * - aic23 audio chip at 0x1a
193 * - on Mistral, 24c04 eeprom at 0x50
194 * - optionally on Mistral, ov9640 camera sensor at 0x30
195 */
196};
197
182static void __init osk_init_smc91x(void) 198static void __init osk_init_smc91x(void)
183{ 199{
184 if ((omap_request_gpio(0)) < 0) { 200 if ((omap_request_gpio(0)) < 0) {
@@ -397,6 +413,14 @@ static void __init osk_init(void)
397 omap_board_config_size = ARRAY_SIZE(osk_config); 413 omap_board_config_size = ARRAY_SIZE(osk_config);
398 USB_TRANSCEIVER_CTRL_REG |= (3 << 1); 414 USB_TRANSCEIVER_CTRL_REG |= (3 << 1);
399 415
416 /* irq for tps65010 chip */
417 /* bootloader effectively does: omap_cfg_reg(U19_1610_MPUIO1); */
418 if (gpio_request(OMAP_MPUIO(1), "tps65010") == 0)
419 gpio_direction_input(OMAP_MPUIO(1));
420
421 i2c_register_board_info(1, osk_i2c_board_info,
422 ARRAY_SIZE(osk_i2c_board_info));
423
400 omap_serial_init(); 424 omap_serial_init();
401 osk_mistral_init(); 425 osk_mistral_init();
402} 426}
@@ -406,6 +430,44 @@ static void __init osk_map_io(void)
406 omap1_map_common_io(); 430 omap1_map_common_io();
407} 431}
408 432
433#ifdef CONFIG_TPS65010
434static int __init osk_tps_init(void)
435{
436 if (!machine_is_omap_osk())
437 return 0;
438
439 /* Let LED1 (D9) blink */
440 tps65010_set_led(LED1, BLINK);
441
442 /* Disable LED 2 (D2) */
443 tps65010_set_led(LED2, OFF);
444
445 /* Set GPIO 1 HIGH to disable VBUS power supply;
446 * OHCI driver powers it up/down as needed.
447 */
448 tps65010_set_gpio_out_value(GPIO1, HIGH);
449
450 /* Set GPIO 2 low to turn on LED D3 */
451 tps65010_set_gpio_out_value(GPIO2, HIGH);
452
453 /* Set GPIO 3 low to take ethernet out of reset */
454 tps65010_set_gpio_out_value(GPIO3, LOW);
455
456 /* gpio4 for VDD_DSP */
457 /* FIXME send power to DSP iff it's configured */
458
459 /* Enable LOW_PWR */
460 tps65010_set_low_pwr(ON);
461
462 /* Switch VLDO2 to 3.0V for AIC23 */
463 tps65010_config_vregs1(TPS_LDO2_ENABLE | TPS_VLDO2_3_0V
464 | TPS_LDO1_ENABLE);
465
466 return 0;
467}
468fs_initcall(osk_tps_init);
469#endif
470
409MACHINE_START(OMAP_OSK, "TI-OSK") 471MACHINE_START(OMAP_OSK, "TI-OSK")
410 /* Maintainer: Dirk Behme <dirk.behme@de.bosch.com> */ 472 /* Maintainer: Dirk Behme <dirk.behme@de.bosch.com> */
411 .phys_io = 0xfff00000, 473 .phys_io = 0xfff00000,