Is this fine ?I tested various development board based on Samsung Exynos series SoC.okay then how about adding a flag for inverted logic too. something like this
Although some gpio of Exynos series SoC set high state(non zero, 1) as default value,
this gpio state could mean off state, disconnected or un-powered state according to gpio.
Of course, above explanation about specific gpio don't include all gpios.
This is meaning that there is possibility.
if(of_property_read_bool(np,"inverted_gpio))
gpio_usbvid->gpio_inv = 1;
And always check on this before deciding?
I could'nt actually parse this. You meant since the id_irq_handler handles both USB and USB-HOST cable
No gpio-usb-id is used in dra7xx. dra7xx has got only ID pin routed via gpio.As you explained about case 1, it is only used on dra7x SoC.Second,The driver has 2 configurations.
gpio_usbvid_set_initial_state() dertermine both "USB-HOST" and "USB" cable state at same time
in 'case ID_DETCT' according to 'gpio_usbvid->id_gpio'. But, I think that other extcon devices
would not control both "USB-HOST" and "USB" cable state at same time.
Other extcon devices would support either "USB-HOST" or "USB" cable.
1) supports implementations with both VBUS and ID pin are routed via gpio's for swicthing roles(compatible gpio-usb-vid).
Other SoC could not wish to control both "USB-HOST" and "USB" cable at same time.
I need your answer about above my opinion for other SoC.So how about this, I have removed the dra7x specific stuffs (gpio-usb-id)
Do you still feel its dra7x specific if i modify it as above?As you mentioned, we cannot only control either USB or USB-HOST cable on this extcon driver.I have some confusion. I need additional your explanation.If compatible == ID_DETECT, only one handler --> id_irq_handler() and it will handle both USB and USB-HOST
Could this driver register only one interrupt handler either id_irq_handler() or vbus_irq_handler()?
orIf compatible == VBUS_ID_DETECT, 2 handlers --> id_irq_handler() will handle USB-HOST and vbus_irq_handler will handle USB.
Could this driver register two interrupt handler both id_irq_handler() or vbus_irq_handler()?
This extcon driver is only suitable dra7x SoC.
Because id_irq_handler() control both "USB-HOST" and "USB" cable at same time,So if i remove that part then?
you need this setting order between "USB-HOST" and "USB" cable.
yesI think that the setting order between cables isn't general. It is specific method for dra7x SoC.
okayIt isn't general.Did you think that SoC should always connect either "USB-HOST" cable or "USB" cable?No, even if a physical cable is not connected it should default to either USB-HOST or USB
If physical cable isn't connected to extcon device, the state both USB-HOST and USB cable
should certainly be zero. Because The extcon consumer driver could set proper operation
according to cable state.
Hope i could answer you :-)
I need your answer about above my opinion.
I don't know this case except for dra7x SoC. So, I think it has dependency on specific SoC.
and can't agree as generic extcon gpio driver.