2
0
forked from Ivasoft/openwrt

make rtl8366 driver OF capable

SVN-Revision: 34682
This commit is contained in:
John Crispin
2012-12-15 01:59:08 +00:00
parent 5ba9873914
commit d8678644f9
6 changed files with 121 additions and 66 deletions

View File

@@ -11,7 +11,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/of_platform.h>
#include <linux/delay.h>
#include <linux/skbuff.h>
#include <linux/rtl8367.h>
@@ -1459,21 +1459,10 @@ static int __devinit rtl8367b_probe(struct platform_device *pdev)
struct rtl8366_smi *smi;
int err;
pdata = pdev->dev.platform_data;
if (!pdata) {
dev_err(&pdev->dev, "no platform data specified\n");
err = -EINVAL;
goto err_out;
}
smi = rtl8366_smi_probe(pdev);
if (!smi)
return -ENODEV;
smi = rtl8366_smi_alloc(&pdev->dev);
if (!smi) {
err = -ENOMEM;
goto err_out;
}
smi->gpio_sda = pdata->gpio_sda;
smi->gpio_sck = pdata->gpio_sck;
smi->clk_delay = 1500;
smi->cmd_read = 0xb9;
smi->cmd_write = 0xb8;
@@ -1527,10 +1516,19 @@ static void rtl8367b_shutdown(struct platform_device *pdev)
rtl8367b_reset_chip(smi);
}
#ifdef CONFIG_OF
static const struct of_device_id rtl8367b_match[] = {
{ .compatible = "rtl8367b" },
{},
};
MODULE_DEVICE_TABLE(of, rtl8367b_match);
#endif
static struct platform_driver rtl8367b_driver = {
.driver = {
.name = RTL8367B_DRIVER_NAME,
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(rtl8367b_match),
},
.probe = rtl8367b_probe,
.remove = __devexit_p(rtl8367b_remove),