Changeset 25120


Ignore:
Timestamp:
2011-01-26T21:35:46+01:00 (5 years ago)
Author:
juhosg
Message:

generic: rtl8366s: allow initial register values to be passed via platform_data

Location:
trunk/target/linux/generic/files
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/generic/files/drivers/net/phy/rtl8366s.c

    r24939 r25120  
    252252static int rtl8366s_hw_init(struct rtl8366_smi *smi) 
    253253{ 
     254        struct rtl8366s_platform_data *pdata; 
    254255        int err; 
     256 
     257        pdata = smi->parent->platform_data; 
     258        if (pdata->num_initvals && pdata->initvals) { 
     259                unsigned i; 
     260 
     261                dev_info(smi->parent, "applying initvals\n"); 
     262                for (i = 0; i < pdata->num_initvals; i++) 
     263                        REG_WR(smi, pdata->initvals[i].reg, 
     264                               pdata->initvals[i].val); 
     265        } 
    255266 
    256267        /* set maximum packet length to 1536 bytes */ 
  • trunk/target/linux/generic/files/include/linux/rtl8366s.h

    r21952 r25120  
    1414#define RTL8366S_DRIVER_NAME    "rtl8366s" 
    1515 
     16struct rtl8366s_initval { 
     17        unsigned        reg; 
     18        u16             val; 
     19}; 
     20 
    1621struct rtl8366s_platform_data { 
    1722        unsigned        gpio_sda; 
    1823        unsigned        gpio_sck; 
     24        unsigned        num_initvals; 
     25        struct rtl8366s_initval *initvals; 
    1926}; 
    2027 
Note: See TracChangeset for help on using the changeset viewer.