~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to arch/arm/mach-at91/at91sam9261_devices.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
426
426
                at91_set_A_periph(AT91_PIN_PA1, 0);     /* SPI0_MOSI */
427
427
                at91_set_A_periph(AT91_PIN_PA2, 0);     /* SPI0_SPCK */
428
428
 
429
 
                at91_clock_associate("spi0_clk", &at91sam9261_spi0_device.dev, "spi_clk");
430
429
                platform_device_register(&at91sam9261_spi0_device);
431
430
        }
432
431
        if (enable_spi1) {
434
433
                at91_set_A_periph(AT91_PIN_PB31, 0);    /* SPI1_MOSI */
435
434
                at91_set_A_periph(AT91_PIN_PB29, 0);    /* SPI1_SPCK */
436
435
 
437
 
                at91_clock_associate("spi1_clk", &at91sam9261_spi1_device.dev, "spi_clk");
438
436
                platform_device_register(&at91sam9261_spi1_device);
439
437
        }
440
438
}
581
579
 
582
580
static void __init at91_add_device_tc(void)
583
581
{
584
 
        /* this chip has a separate clock and irq for each TC channel */
585
 
        at91_clock_associate("tc0_clk", &at91sam9261_tcb_device.dev, "t0_clk");
586
 
        at91_clock_associate("tc1_clk", &at91sam9261_tcb_device.dev, "t1_clk");
587
 
        at91_clock_associate("tc2_clk", &at91sam9261_tcb_device.dev, "t2_clk");
588
582
        platform_device_register(&at91sam9261_tcb_device);
589
583
}
590
584
#else
786
780
        case AT91SAM9261_ID_SSC0:
787
781
                pdev = &at91sam9261_ssc0_device;
788
782
                configure_ssc0_pins(pins);
789
 
                at91_clock_associate("ssc0_clk", &pdev->dev, "pclk");
790
783
                break;
791
784
        case AT91SAM9261_ID_SSC1:
792
785
                pdev = &at91sam9261_ssc1_device;
793
786
                configure_ssc1_pins(pins);
794
 
                at91_clock_associate("ssc1_clk", &pdev->dev, "pclk");
795
787
                break;
796
788
        case AT91SAM9261_ID_SSC2:
797
789
                pdev = &at91sam9261_ssc2_device;
798
790
                configure_ssc2_pins(pins);
799
 
                at91_clock_associate("ssc2_clk", &pdev->dev, "pclk");
800
791
                break;
801
792
        default:
802
793
                return;
989
980
void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
990
981
{
991
982
        struct platform_device *pdev;
 
983
        struct atmel_uart_data *pdata;
992
984
 
993
985
        switch (id) {
994
986
                case 0:         /* DBGU */
995
987
                        pdev = &at91sam9261_dbgu_device;
996
988
                        configure_dbgu_pins();
997
 
                        at91_clock_associate("mck", &pdev->dev, "usart");
998
989
                        break;
999
990
                case AT91SAM9261_ID_US0:
1000
991
                        pdev = &at91sam9261_uart0_device;
1001
992
                        configure_usart0_pins(pins);
1002
 
                        at91_clock_associate("usart0_clk", &pdev->dev, "usart");
1003
993
                        break;
1004
994
                case AT91SAM9261_ID_US1:
1005
995
                        pdev = &at91sam9261_uart1_device;
1006
996
                        configure_usart1_pins(pins);
1007
 
                        at91_clock_associate("usart1_clk", &pdev->dev, "usart");
1008
997
                        break;
1009
998
                case AT91SAM9261_ID_US2:
1010
999
                        pdev = &at91sam9261_uart2_device;
1011
1000
                        configure_usart2_pins(pins);
1012
 
                        at91_clock_associate("usart2_clk", &pdev->dev, "usart");
1013
1001
                        break;
1014
1002
                default:
1015
1003
                        return;
1016
1004
        }
1017
 
        pdev->id = portnr;              /* update to mapped ID */
 
1005
        pdata = pdev->dev.platform_data;
 
1006
        pdata->num = portnr;            /* update to mapped ID */
1018
1007
 
1019
1008
        if (portnr < ATMEL_MAX_UART)
1020
1009
                at91_uarts[portnr] = pdev;
1022
1011
 
1023
1012
void __init at91_set_serial_console(unsigned portnr)
1024
1013
{
1025
 
        if (portnr < ATMEL_MAX_UART)
 
1014
        if (portnr < ATMEL_MAX_UART) {
1026
1015
                atmel_default_console_device = at91_uarts[portnr];
 
1016
                at91sam9261_set_console_clock(at91_uarts[portnr]->id);
 
1017
        }
1027
1018
}
1028
1019
 
1029
1020
void __init at91_add_device_serial(void)