}
EXPORT_SYMBOL_GPL(rtl8366_smi_rmwr);
+static int rtl8366_reset(struct rtl8366_smi *smi)
+{
+ if (smi->hw_reset) {
+ smi->hw_reset(true);
+ msleep(25);
+ smi->hw_reset(false);
+ msleep(25);
+ return 0;
+ }
+
+ return smi->ops->reset_chip(smi);
+}
+
static int rtl8366_mc_is_used(struct rtl8366_smi *smi, int mc_index, int *used)
{
int err;
struct rtl8366_smi *smi = sw_to_rtl8366_smi(dev);
int err;
- err = smi->ops->reset_chip(smi);
+ err = rtl8366_reset(smi);
if (err)
return err;
}
spin_lock_init(&smi->lock);
+
+ /* start the switch */
+ if (smi->hw_reset) {
+ smi->hw_reset(false);
+ msleep(25);
+ }
+
return 0;
err_free_sda:
static void __rtl8366_smi_cleanup(struct rtl8366_smi *smi)
{
+ if (smi->hw_reset)
+ smi->hw_reset(true);
+
gpio_free(smi->gpio_sck);
gpio_free(smi->gpio_sda);
}
goto err_free_sck;
}
- err = smi->ops->reset_chip(smi);
+ err = rtl8366_reset(smi);
if (err)
goto err_free_sck;