Commit 65655b5a94f6fc7e6450e3e07f2687c523c71c08

Authored by Atsushi Nemoto
Committed by Ralf Baechle
1 parent 42fe7ee31f

MIPS: TXx9: Add support for TX4939 internal RTC

Add platform support to use rtc-tx4939 driver.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

Showing 3 changed files with 24 additions and 0 deletions Side-by-side Diff

arch/mips/include/asm/txx9/tx4939.h
... ... @@ -541,6 +541,7 @@
541 541 int tx4939_irq(void);
542 542 void tx4939_mtd_init(int ch);
543 543 void tx4939_ata_init(void);
  544 +void tx4939_rtc_init(void);
544 545  
545 546 #endif /* __ASM_TXX9_TX4939_H */
arch/mips/txx9/generic/setup_tx4939.c
... ... @@ -435,6 +435,28 @@
435 435 platform_device_register(&ata1_dev);
436 436 }
437 437  
  438 +void __init tx4939_rtc_init(void)
  439 +{
  440 + static struct resource res[] = {
  441 + {
  442 + .start = TX4939_RTC_REG & 0xfffffffffULL,
  443 + .end = (TX4939_RTC_REG & 0xfffffffffULL) + 0x100 - 1,
  444 + .flags = IORESOURCE_MEM,
  445 + }, {
  446 + .start = TXX9_IRQ_BASE + TX4939_IR_RTC,
  447 + .flags = IORESOURCE_IRQ,
  448 + },
  449 + };
  450 + static struct platform_device rtc_dev = {
  451 + .name = "tx4939rtc",
  452 + .id = -1,
  453 + .num_resources = ARRAY_SIZE(res),
  454 + .resource = res,
  455 + };
  456 +
  457 + platform_device_register(&rtc_dev);
  458 +}
  459 +
438 460 static void __init tx4939_stop_unused_modules(void)
439 461 {
440 462 __u64 pcfg, rst = 0, ckd = 0;
arch/mips/txx9/rbtx4939/setup.c
... ... @@ -336,6 +336,7 @@
336 336 rbtx4939_led_setup();
337 337 tx4939_wdt_init();
338 338 tx4939_ata_init();
  339 + tx4939_rtc_init();
339 340 }
340 341  
341 342 static void __init rbtx4939_setup(void)