@@ -21,6 +21,7 @@
* the file called "COPYING".
*/
+#include <linux/gpio.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
@@ -2759,6 +2760,9 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
ndev->features = NETIF_F_HW_VLAN_CTAG_FILTER;
}
+ if (pd->needs_gpio_reset)
+ gpio_request_one(pd->reset_gpio, GPIOF_OUT_INIT_HIGH, NULL);
+
/* initialize first or needed device */
if (!devno || pd->needs_init) {
if (mdp->cd->chip_reset)
@@ -22,6 +22,9 @@ struct sh_eth_plat_data {
unsigned no_ether_link:1;
unsigned ether_link_active_low:1;
unsigned needs_init:1;
+ unsigned needs_gpio_reset:1;
+
+ unsigned reset_gpio; /* Used if needs_gpio_reset is true */
};
#endif
Allow reset using a GPIO. In order to use this set the following in the device's platform data: needs_gpio_reset = 1 reset_gpio = GPIO pin to use This patch is motivated by the lager board which uses the r8a7790 SoC which has a GPIO pin to reset its sh_eth device. Signed-off-by: Simon Horman <horms+renesas@verge.net.au> -- v2 * First post --- drivers/net/ethernet/renesas/sh_eth.c | 4 ++++ include/linux/sh_eth.h | 3 +++ 2 files changed, 7 insertions(+)