From e27d817e3c968624f7ae454f9b643157a2d39dab Mon Sep 17 00:00:00 2001 From: Steinar Bakkemo Date: Thu, 8 Oct 2020 20:34:32 +0200 Subject: [PATCH] otgcontrol: add debug hack disabling OTG detection in default state Due to the authorized mode (default state) not being implemented properly yet with filtering and such, a concern regarding short while in a bag or such was discussed. As a hot fix, the device connection (POGO ID pin) is deactivated in default mode until this has been properly implemented, but enabled when explicitly entering unauthorized mode from the test-application in order to use the QR code reader. --- drivers/misc/rm-otgcontrol/otgcontrol_fsm.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/misc/rm-otgcontrol/otgcontrol_fsm.c b/drivers/misc/rm-otgcontrol/otgcontrol_fsm.c index 4df112b38d47..87425b164e9e 100644 --- a/drivers/misc/rm-otgcontrol/otgcontrol_fsm.c +++ b/drivers/misc/rm-otgcontrol/otgcontrol_fsm.c @@ -188,7 +188,8 @@ static int otgcontrol_reset_fsm(struct rm_otgcontrol_data *otgc_data) "%s: Activating one-wire GPIO IRQ\n", __func__); - otgcontrol_activate_gpio_irq(otgc_data); + /* otgcontrol_activate_gpio_irq(otgc_data);*/ + otgcontrol_deactivate_gpio_irq(otgc_data); dev_dbg(otgc_data->dev, "%s: Checking if device is connected and initiating default " @@ -1282,6 +1283,8 @@ static int otgcontrol_do_set_controlmode( otgc_data->otg_controlstate = OTG1_STATE__MANUAL_CONTROL; otgc_data->otg1_controllermode = OTG_MODE__MANUAL_CONTROL; + + otgcontrol_deactivate_gpio_irq(otgc_data); break; case OTG_MODE__ONEWIRE_AUTH: @@ -1303,6 +1306,8 @@ static int otgcontrol_do_set_controlmode( otgc_data->otg_controlstate = OTG1_STATE__ONEWIRE_AUTH_NOT_CONNECTED; } otgc_data->otg1_controllermode = OTG_MODE__ONEWIRE_AUTH; + + otgcontrol_deactivate_gpio_irq(otgc_data); break; case OTG_MODE__USB_NO_AUTH: @@ -1324,6 +1329,8 @@ static int otgcontrol_do_set_controlmode( otgc_data->otg_controlstate = OTG1_STATE__USB_NO_AUTH_NOT_CONNECTED; } otgc_data->otg1_controllermode = OTG_MODE__USB_NO_AUTH; + + otgcontrol_activate_gpio_irq(otgc_data); break; default: @@ -1504,7 +1511,9 @@ static int otgcontrol_do_device_disconnected_procedure( "%s: Activating one-wire GPIO IRQ\n", __func__); - otgcontrol_activate_gpio_irq(otgc_data); + /* otgcontrol_activate_gpio_irq(otgc_data);*/ + if (otgc_data->otg1_controllermode == OTG_MODE__USB_NO_AUTH) + otgcontrol_activate_gpio_irq(otgc_data); return 0; }