static struct platform_device *cpcap_devices[] = {
&cpcap_validity_device,
- &cpcap_whisper_device,
&cpcap_notification_led,
&cpcap_privacy_led,
&cpcap_3mm5_device,
for (i = 0; i < ARRAY_SIZE(cpcap_devices); i++)
cpcap_device_register(cpcap_devices[i]);
+ if (!stingray_qbp_usb_hw_bypass_enabled())
+ cpcap_device_register(&cpcap_whisper_device);
+
(void) cpcap_driver_register(&cpcap_validity_driver);
i2c_register_board_info(3, stingray_i2c_bus4_power_info,
}
__setup("hw_rev=", stingray_revision_parse);
+int stingray_qbp_usb_hw_bypass_enabled(void)
+{
+ /* We could use the boot_mode string instead of probing the HW, but
+ * that would not work if we enable run-time switching to this mode
+ * in the future.
+ */
+ if (gpio_get_value(TEGRA_GPIO_PT3) && !gpio_get_value(TEGRA_GPIO_PV4)) {
+ pr_info("stingray_qbp_usb_hw_bypass enabled\n");
+ return 1;
+ }
+ return 0;
+}
+
static struct tegra_suspend_platform_data stingray_suspend = {
.cpu_timer = 1500,
.cpu_off_timer = 1,
tegra_common_init();
tegra_init_suspend(&stingray_suspend);
- /* Stingray has a USB switch that disconnects the usb port from the AP20
+ /* Stingray has a USB switch that disconnects the usb port from the T20
unless a factory cable is used, the factory jumper is set, or the
usb_data_en gpio is set.
*/
- tegra_gpio_enable(TEGRA_GPIO_PV4);
- gpio_request(TEGRA_GPIO_PV4, "usb_data_en");
- gpio_direction_output(TEGRA_GPIO_PV4, 1);
+ if (!stingray_qbp_usb_hw_bypass_enabled()) {
+ tegra_gpio_enable(TEGRA_GPIO_PV4);
+ gpio_request(TEGRA_GPIO_PV4, "usb_data_en");
+ gpio_direction_output(TEGRA_GPIO_PV4, 1);
+ }
/* USB_FORCEON_N (TEGRA_GPIO_PC5) should be forced high at boot
and will be pulled low by the hardware on attach */
unsigned int stingray_revision(void);
unsigned int stingray_powerup_reason (void);
void stingray_gps_init(void);
+int stingray_qbp_usb_hw_bypass_enabled(void);
/* as defined in the bootloader*/
#define HWREV(x) (((x)>>16) & 0xFFFF)