mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-12-26 15:26:46 +02:00
generic: rtl8366s: allow initial register values to be passed via platform_data
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@25120 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
2f9a16818c
commit
f1f92beb2e
@ -251,8 +251,19 @@ static int rtl8366s_reset_chip(struct rtl8366_smi *smi)
|
|||||||
|
|
||||||
static int rtl8366s_hw_init(struct rtl8366_smi *smi)
|
static int rtl8366s_hw_init(struct rtl8366_smi *smi)
|
||||||
{
|
{
|
||||||
|
struct rtl8366s_platform_data *pdata;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
|
pdata = smi->parent->platform_data;
|
||||||
|
if (pdata->num_initvals && pdata->initvals) {
|
||||||
|
unsigned i;
|
||||||
|
|
||||||
|
dev_info(smi->parent, "applying initvals\n");
|
||||||
|
for (i = 0; i < pdata->num_initvals; i++)
|
||||||
|
REG_WR(smi, pdata->initvals[i].reg,
|
||||||
|
pdata->initvals[i].val);
|
||||||
|
}
|
||||||
|
|
||||||
/* set maximum packet length to 1536 bytes */
|
/* set maximum packet length to 1536 bytes */
|
||||||
REG_RMW(smi, RTL8366S_SGCR, RTL8366S_SGCR_MAX_LENGTH_MASK,
|
REG_RMW(smi, RTL8366S_SGCR, RTL8366S_SGCR_MAX_LENGTH_MASK,
|
||||||
RTL8366S_SGCR_MAX_LENGTH_1536);
|
RTL8366S_SGCR_MAX_LENGTH_1536);
|
||||||
|
@ -13,9 +13,16 @@
|
|||||||
|
|
||||||
#define RTL8366S_DRIVER_NAME "rtl8366s"
|
#define RTL8366S_DRIVER_NAME "rtl8366s"
|
||||||
|
|
||||||
|
struct rtl8366s_initval {
|
||||||
|
unsigned reg;
|
||||||
|
u16 val;
|
||||||
|
};
|
||||||
|
|
||||||
struct rtl8366s_platform_data {
|
struct rtl8366s_platform_data {
|
||||||
unsigned gpio_sda;
|
unsigned gpio_sda;
|
||||||
unsigned gpio_sck;
|
unsigned gpio_sck;
|
||||||
|
unsigned num_initvals;
|
||||||
|
struct rtl8366s_initval *initvals;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* _RTL8366_SMI_H */
|
#endif /* _RTL8366_SMI_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user