aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1/board-ams-delta.c
diff options
context:
space:
mode:
authorJanusz Krzysztofik <jkrzyszt@tis.icnet.pl>2012-03-05 11:05:11 -0500
committerTony Lindgren <tony@atomide.com>2012-03-05 14:24:30 -0500
commitaabf31737a6a5eb0c4d73857409cd5bcc914d5f5 (patch)
treeeda335fb96d06f686d87bc61d7e79d41b2fa8645 /arch/arm/mach-omap1/board-ams-delta.c
parentac2885df30e2597d627ad619c01b6fc55ac540a7 (diff)
ARM: OMAP1: ams-delta: update the modem to use regulator API
After the CX20442 codec driver already takes care of enabling the codec power for itself (commit f75a8ff67d161b5166a2c2360bb2ffaefd5eb853, "ASoC: cx20442: add bias control over a platform provided regulator"), but before dropping the old bias control method from the Amstrad Delta ASoC sound card file, which in fact keeps the modem power always on, even on the ASoC device close for now, extend the modem setup with a power management callback which toggles the regulator up to the modem's needs, reusing the previously set up regulator consumer for this. Also, drop the MODEM_NRESET pin setup from the modem initialization procedure, as this operation was already ineffective since patch 1/3, and not needed because the regulator is set up as initially enabled. Depends on patch 1/3 "ARM: OMAP1: ams-delta: set up regulator over modem reset GPIO pin" to apply cleanly. Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> Cc: Tony Lindgren <tony@atomide.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap1/board-ams-delta.c')
-rw-r--r--arch/arm/mach-omap1/board-ams-delta.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
index 949997c35707..2fb2cbb1e105 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -526,6 +526,16 @@ static void __init ams_delta_init(void)
526 omap_writew(omap_readw(ARM_RSTCT1) | 0x0004, ARM_RSTCT1); 526 omap_writew(omap_readw(ARM_RSTCT1) | 0x0004, ARM_RSTCT1);
527} 527}
528 528
529static void modem_pm(struct uart_port *port, unsigned int state, unsigned old)
530{
531 struct modem_private_data *priv = port->private_data;
532
533 if (state == old)
534 return;
535
536 regulator_toggle(priv, state == 0);
537}
538
529static struct plat_serial8250_port ams_delta_modem_ports[] = { 539static struct plat_serial8250_port ams_delta_modem_ports[] = {
530 { 540 {
531 .membase = IOMEM(MODEM_VIRT), 541 .membase = IOMEM(MODEM_VIRT),
@@ -536,6 +546,8 @@ static struct plat_serial8250_port ams_delta_modem_ports[] = {
536 .iotype = UPIO_MEM, 546 .iotype = UPIO_MEM,
537 .regshift = 1, 547 .regshift = 1,
538 .uartclk = BASE_BAUD * 16, 548 .uartclk = BASE_BAUD * 16,
549 .pm = modem_pm,
550 .private_data = &modem_priv,
539 }, 551 },
540 { }, 552 { },
541}; 553};
@@ -584,9 +596,8 @@ static int __init late_init(void)
584 mutex_init(&modem_priv.consumer.lock); 596 mutex_init(&modem_priv.consumer.lock);
585 modem_priv.regulator = ERR_PTR(-ENODEV); 597 modem_priv.regulator = ERR_PTR(-ENODEV);
586 598
587 ams_delta_latch2_write( 599 ams_delta_latch2_write(AMS_DELTA_LATCH2_MODEM_CODEC,
588 AMS_DELTA_LATCH2_MODEM_NRESET | AMS_DELTA_LATCH2_MODEM_CODEC, 600 AMS_DELTA_LATCH2_MODEM_CODEC);
589 AMS_DELTA_LATCH2_MODEM_NRESET | AMS_DELTA_LATCH2_MODEM_CODEC);
590 601
591 err = platform_device_register(&ams_delta_modem_device); 602 err = platform_device_register(&ams_delta_modem_device);
592 if (err) 603 if (err)
@@ -595,8 +606,9 @@ static int __init late_init(void)
595 /* 606 /*
596 * Once the modem device is registered, the modem_nreset 607 * Once the modem device is registered, the modem_nreset
597 * regulator can be requested on behalf of that device. 608 * regulator can be requested on behalf of that device.
598 * The regulator is used via ams_delta_latch_write() 609 * In addition to the modem .pm callback, that regulator
599 * by the modem and ASoC drivers until updated. 610 * is still used via the ams_delta_latch_write() wrapper
611 * by the ASoC driver until updated.
600 */ 612 */
601 modem_priv.regulator = regulator_get(&ams_delta_modem_device.dev, 613 modem_priv.regulator = regulator_get(&ams_delta_modem_device.dev,
602 "RESET#"); 614 "RESET#");