source: trunk/target/linux/lantiq/patches-3.0/420-spi3.patch @ 28308

Last change on this file since 28308 was 28308, checked in by blogic, 5 years ago

[lantiq]

  • rebase 3.0 patches
  • fold some fixes into existing patches
File size: 2.7 KB
  • arch/mips/lantiq/xway/devices.h

    From: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
    Date: Thu, 3 Mar 2011 20:42:26 +0000 (+0100)
    Subject: MIPS: lantiq: Add device register helper for SPI controller and devices
    X-Git-Url: http://nbd.name/gitweb.cgi?p=lantiq.git;a=commitdiff_plain;h=b35b07062b718ece9b9cb7b23b12d83a087eafb0;hp=653c95b8b9066c9c6ac08bd64d0ceee439e9fd90
    
    MIPS: lantiq: Add device register helper for SPI controller and devices
    
    Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
    ---
    
    a b  
    1111 
    1212#include "../devices.h" 
    1313#include <linux/phy.h> 
     14#include <linux/spi/spi.h> 
    1415 
    1516extern void ltq_register_gpio(void); 
    1617extern void ltq_register_gpio_stp(void); 
    1718extern void ltq_register_ase_asc(void); 
    1819extern void ltq_register_etop(struct ltq_eth_data *eth); 
     20extern void ltq_register_spi(struct ltq_spi_platform_data *pdata, 
     21        struct spi_board_info const *info, unsigned n); 
    1922 
    2023#endif 
  • arch/mips/lantiq/xway/devices.c

    a b  
    2121#include <linux/io.h> 
    2222#include <linux/gpio.h> 
    2323#include <linux/leds.h> 
     24#include <linux/spi/spi.h> 
    2425 
    2526#include <asm/bootinfo.h> 
    2627#include <asm/irq.h> 
    ltq_register_etop(struct ltq_eth_data *e 
    119120                platform_device_register(&ltq_etop); 
    120121        } 
    121122} 
     123 
     124static struct resource ltq_spi_resources[] = { 
     125        { 
     126                .start  = LTQ_SSC_BASE_ADDR, 
     127                .end    = LTQ_SSC_BASE_ADDR + LTQ_SSC_SIZE - 1, 
     128                .flags  = IORESOURCE_MEM, 
     129        }, 
     130        IRQ_RES(spi_tx, LTQ_SSC_TIR), 
     131        IRQ_RES(spi_rx, LTQ_SSC_RIR), 
     132        IRQ_RES(spi_err, LTQ_SSC_EIR), 
     133}; 
     134 
     135static struct resource ltq_spi_resources_ar9[] = { 
     136        { 
     137                .start  = LTQ_SSC_BASE_ADDR, 
     138                .end    = LTQ_SSC_BASE_ADDR + LTQ_SSC_SIZE - 1, 
     139                .flags  = IORESOURCE_MEM, 
     140        }, 
     141        IRQ_RES(spi_tx, LTQ_SSC_TIR_AR9), 
     142        IRQ_RES(spi_rx, LTQ_SSC_RIR_AR9), 
     143        IRQ_RES(spi_err, LTQ_SSC_EIR), 
     144}; 
     145 
     146static struct platform_device ltq_spi = { 
     147        .name           = "ltq-spi", 
     148        .resource       = ltq_spi_resources, 
     149        .num_resources  = ARRAY_SIZE(ltq_spi_resources), 
     150}; 
     151 
     152void __init ltq_register_spi(struct ltq_spi_platform_data *pdata, 
     153                struct spi_board_info const *info, unsigned n) 
     154{ 
     155        if(ltq_is_ar9()) 
     156                ltq_spi.resource = ltq_spi_resources_ar9; 
     157        spi_register_board_info(info, n); 
     158        ltq_spi.dev.platform_data = pdata; 
     159        platform_device_register(&ltq_spi); 
     160} 
  • arch/mips/include/asm/mach-lantiq/xway/lantiq_irq.h

    a b  
    2727 
    2828#define LTQ_SSC_TIR             (INT_NUM_IM0_IRL0 + 15) 
    2929#define LTQ_SSC_RIR             (INT_NUM_IM0_IRL0 + 14) 
     30#define LTQ_SSC_TIR_AR9         (INT_NUM_IM0_IRL0 + 14) 
     31#define LTQ_SSC_RIR_AR9         (INT_NUM_IM0_IRL0 + 15) 
    3032#define LTQ_SSC_EIR             (INT_NUM_IM0_IRL0 + 16) 
    3133 
    3234#define LTQ_MEI_DYING_GASP_INT  (INT_NUM_IM1_IRL0 + 21) 
Note: See TracBrowser for help on using the repository browser.