/*
* arch/arm64/boot/dts/tegra210-platforms/tegra210-loki-e-gamepad-reset.dtsi
*
- * Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
name = "gamepad_reset";
reset_gpio = <TEGRA_GPIO(H, 1)>;
+ status = "okay";
};
};
/*
* NVIDIA Gamepad Reset Driver for NVIDIA Shield-2
*
- * Copyright (c) 2014, NVIDIA Corporation. All Rights Reserved.
+ * Copyright (c) 2014-2015, NVIDIA Corporation. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
return 0;
}
+int gamepad_reset_gpio = -1;
+void gamepad_reset_war(void)
+{
+ int ret;
+
+ ret = gpio_request(gamepad_reset_gpio, "GAMEPAD_RST");
+ if (ret < 0) {
+ pr_err("%s: gpio_request failed %d\n", __func__, ret);
+ return;
+ }
+
+ ret = gpio_direction_output(gamepad_reset_gpio, 1);
+ if (ret < 0) {
+ gpio_free(gamepad_reset_gpio);
+ pr_err("%s: gpio_direction_output failed %d\n", __func__, ret);
+ return;
+ }
+
+ pr_info("%s: xusb WAR - resetting gamepad\n", __func__);
+ gpio_set_value(gamepad_reset_gpio, 0);
+ udelay(RESET_DELAY);
+ gpio_set_value(gamepad_reset_gpio, 1);
+ gpio_free(gamepad_reset_gpio);
+}
+EXPORT_SYMBOL(gamepad_reset_war);
+
static int gamepad_reset_probe(struct platform_device *pdev)
{
int ret;
}
data->reset_gpio = pdata->reset_gpio;
#endif
+ gamepad_reset_gpio = data->reset_gpio;
platform_set_drvdata(pdev, data);
return 0;
}
+#ifdef CONFIG_NV_GAMEPAD_RESET
+static void tegra_loki_gamepad_reset(void)
+{
+ struct device_node *np = of_find_node_by_name(NULL, "gamepad-reset");
+
+ if (np) {
+ if (of_device_is_available(np))
+ gamepad_reset_war();
+ }
+}
+#endif
+
static const struct hc_driver tegra_plat_xhci_driver = {
.description = "tegra-xhci",
.product_desc = "Nvidia xHCI Host Controller",
tegra_xhci_unregister_plat();
usleep_range(10, 20);
tegra_xhci_register_plat();
+#ifdef CONFIG_NV_GAMEPAD_RESET
+ udelay(10);
+ tegra_loki_gamepad_reset();
+#endif
}
}