1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2025-04-21 12:27:27 +03:00

[kernel] make rtl8366 driver OF capable

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@34682 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
blogic
2012-12-15 01:59:08 +00:00
parent 1971309ae5
commit 6886519f62
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>
@@ -1677,22 +1677,9 @@ static int __devinit rtl8367_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_alloc(&pdev->dev);
if (!smi) {
err = -ENOMEM;
goto err_out;
}
smi->gpio_sda = pdata->gpio_sda;
smi->gpio_sck = pdata->gpio_sck;
smi->hw_reset = pdata->hw_reset;
smi = rtl8366_smi_probe(pdev);
if (!smi)
return -ENODEV;
smi->clk_delay = 1500;
smi->cmd_read = 0xb9;
@@ -1747,10 +1734,19 @@ static void rtl8367_shutdown(struct platform_device *pdev)
rtl8367_reset_chip(smi);
}
#ifdef CONFIG_OF
static const struct of_device_id rtl8367_match[] = {
{ .compatible = "rtl8367" },
{},
};
MODULE_DEVICE_TABLE(of, rtl83767_match);
#endif
static struct platform_driver rtl8367_driver = {
.driver = {
.name = RTL8367_DRIVER_NAME,
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(rtl8367_match),
},
.probe = rtl8367_probe,
.remove = __devexit_p(rtl8367_remove),