Changeset 29549


Ignore:
Timestamp:
2011-12-15T23:25:11+01:00 (4 years ago)
Author:
juhosg
Message:

ar71xx: introduce ar71xx_switch_data

Location:
trunk/target/linux/ar71xx/files
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/ar71xx/files/arch/mips/ar71xx/devices.c

    r29457 r29549  
    527527        }, 
    528528}; 
     529 
     530struct ag71xx_switch_platform_data ar71xx_switch_data; 
    529531 
    530532#define AR71XX_PLL_VAL_1000     0x00110000 
     
    831833                        pdata->speed = SPEED_1000; 
    832834                        pdata->duplex = DUPLEX_FULL; 
    833                         pdata->has_ar7240_switch = 1; 
     835                        pdata->switch_data = &ar71xx_switch_data; 
    834836                } 
    835837                pdata->has_gbit = 1; 
     
    886888                        pdata->speed = SPEED_1000; 
    887889                        pdata->duplex = DUPLEX_FULL; 
    888                         pdata->has_ar7240_switch = 1; 
     890                        pdata->switch_data = &ar71xx_switch_data; 
    889891                } 
    890892 
  • trunk/target/linux/ar71xx/files/arch/mips/ar71xx/devices.h

    r29457 r29549  
    4141void ar71xx_add_device_eth(unsigned int id) __init; 
    4242 
     43extern struct ag71xx_switch_platform_data ar71xx_switch_data; 
     44 
    4345extern struct platform_device ar71xx_mdio0_device; 
    4446extern struct platform_device ar71xx_mdio1_device; 
  • trunk/target/linux/ar71xx/files/arch/mips/include/asm/mach-ar71xx/platform.h

    r29012 r29549  
    1818#include <linux/spi/spi.h> 
    1919 
     20struct ag71xx_switch_platform_data { 
     21        int             dummy; 
     22}; 
     23 
    2024struct ag71xx_platform_data { 
    2125        phy_interface_t phy_if_mode; 
     
    3236        u8              is_ar724x:1; 
    3337        u8              has_ar8216:1; 
    34         u8              has_ar7240_switch:1; 
     38 
     39        struct ag71xx_switch_platform_data *switch_data; 
    3540 
    3641        void            (*ddr_flush)(void); 
  • trunk/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_ar7240.c

    r29541 r29549  
    199199struct ar7240sw { 
    200200        struct mii_bus  *mii_bus; 
     201        struct ag71xx_switch_platform_data *swdata; 
    201202        struct switch_dev swdev; 
    202203        int num_ports; 
     
    844845static struct ar7240sw *ar7240_probe(struct ag71xx *ag) 
    845846{ 
     847        struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag); 
    846848        struct mii_bus *mii = ag->mii_bus; 
    847849        struct ar7240sw *as; 
     
    866868 
    867869        as->mii_bus = mii; 
     870        as->swdata = pdata->switch_data; 
    868871 
    869872        ctrl = ar7240sw_reg_read(mii, AR7240_REG_MASK_CTRL); 
  • trunk/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_phy.c

    r28977 r29549  
    4949        if (ag->phy_dev) { 
    5050                phy_start(ag->phy_dev); 
    51         } else if (pdata->has_ar7240_switch) { 
     51        } else if (pdata->switch_data) { 
    5252                ag71xx_ar7240_start(ag); 
    5353        } else { 
     
    6464        if (ag->phy_dev) 
    6565                phy_stop(ag->phy_dev); 
    66         else if (pdata->has_ar7240_switch) 
    67                         ag71xx_ar7240_stop(ag); 
     66        else if (pdata->switch_data) 
     67                ag71xx_ar7240_stop(ag); 
    6868 
    6969        spin_lock_irqsave(&ag->lock, flags); 
     
    217217        } 
    218218 
    219         if (pdata->has_ar7240_switch) 
     219        if (pdata->switch_data) 
    220220                return ag71xx_ar7240_init(ag); 
    221221 
     
    230230        struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag); 
    231231 
    232         if (pdata->has_ar7240_switch) 
     232        if (pdata->switch_data) 
    233233                ag71xx_ar7240_cleanup(ag); 
    234234        else if (ag->phy_dev) 
Note: See TracChangeset for help on using the changeset viewer.