Changeset 27810


Ignore:
Timestamp:
2011-07-28T12:56:27+02:00 (7 years ago)
Author:
juhosg
Message:

ramips: rt305x: introduce rt305x_register_spi helper

Based on a patch by Sergiy <piratfm@…>

Location:
trunk/target/linux/ramips/files/arch/mips/ralink/rt305x
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/ramips/files/arch/mips/ralink/rt305x/devices.c

    r27392 r27810  
    1515#include <linux/mtd/mtd.h> 
    1616#include <linux/mtd/physmap.h> 
     17#include <linux/spi/spi.h> 
    1718#include <linux/rt2x00_platform.h> 
    1819 
     
    221222        platform_device_register(&rt305x_wdt_device); 
    222223} 
     224 
     225static struct resource rt305x_spi_resources[] = { 
     226        { 
     227                .flags  = IORESOURCE_MEM, 
     228                .start  = RT305X_SPI_BASE, 
     229                .end    = RT305X_SPI_BASE + RT305X_SPI_SIZE - 1, 
     230        }, 
     231}; 
     232 
     233static struct platform_device rt305x_spi_device = { 
     234        .name           = "ramips-spi", 
     235        .id             = 0, 
     236        .resource       = rt305x_spi_resources, 
     237        .num_resources  = ARRAY_SIZE(rt305x_spi_resources), 
     238}; 
     239 
     240void __init rt305x_register_spi(struct spi_board_info *info, int n) 
     241{ 
     242        spi_register_board_info(info, n); 
     243        platform_device_register(&rt305x_spi_device); 
     244} 
  • trunk/target/linux/ramips/files/arch/mips/ralink/rt305x/devices.h

    r25127 r27810  
    1515 
    1616struct physmap_flash_data; 
     17struct spi_board_info; 
    1718 
    1819extern struct rt305x_esw_platform_data rt305x_esw_data; 
     
    2223void rt305x_register_wifi(void); 
    2324void rt305x_register_wdt(void); 
     25void rt305x_register_spi(struct spi_board_info *info, int n); 
    2426 
    2527#endif  /* __RT305X_DEVICES_H */ 
Note: See TracChangeset for help on using the changeset viewer.