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

generic: rtl8366: introduce rtl8366_smi_ops

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21910 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
juhosg
2010-06-26 19:15:57 +00:00
parent 36c0080775
commit d2c03b9bff
4 changed files with 97 additions and 56 deletions

View File

@@ -272,6 +272,9 @@ int rtl8366_smi_init(struct rtl8366_smi *smi)
if (!smi->parent)
return -EINVAL;
if (!smi->ops)
return -EINVAL;
err = gpio_request(smi->gpio_sda, dev_name(smi->parent));
if (err) {
dev_err(smi->parent, "gpio_request failed for %u, err=%d\n",
@@ -291,8 +294,16 @@ int rtl8366_smi_init(struct rtl8366_smi *smi)
dev_info(smi->parent, "using GPIO pins %u (SDA) and %u (SCK)\n",
smi->gpio_sda, smi->gpio_sck);
err = smi->ops->detect(smi);
if (err) {
dev_err(smi->parent, "chip detection failed, err=%d\n", err);
goto err_free_sck;
}
return 0;
err_free_sck:
gpio_free(smi->gpio_sck);
err_free_sda:
gpio_free(smi->gpio_sda);
err_out: