1
0
Fork 0
Commit Graph

17 Commits (e69448bf61fa299985a02e752cf7a2200c6d682b)

Author SHA1 Message Date
Lars Ivar Miljeteig e69448bf61 rm-otgcontrol: Add licensing info 2020-10-08 20:41:29 +02:00
Steinar Bakkemo caeba76d7f otgcontrol: read current GPIO state directly from sysfs attribute_show method
In order to read the current GPIO state regardless of the current controller
mode, and thus regardless of whether the GPIO irq is enabled, a direct
read of the raw GPIO state is done directly from the sysfs attribute_show
method.

Required synchronization was added to the access method to prevent race
if the attribute is read at the same time the irq handler is running.
2020-10-08 20:41:21 +02:00
Steinar Bakkemo 2edbefedce otgcontrol: fix init problem causing uninit. default sysfs controllermode shadow value
When reading the otg controller mode from sysfs before changing it, returns 0.
This is not correct, as the default mode is 1.

As the controllermode is changed, the sysfs attribute shadow value is also changed.
Now also during fsm init.
2020-10-08 20:07:16 +02:00
Steinar Bakkemo b598f8263e otgcontrol: remove un-needed deallocation/un-init code
Ref. discussion on this when using devm_xxx(..) version of
allocation/init routines.
2020-10-08 20:07:11 +02:00
Steinar Bakkemo 2f4756abaa otgcontrol: remove hard-coded one-wire tty device name/path 2020-10-08 20:07:10 +02:00
Steinar Bakkemo fea66edaed otgcontrol: add synch. to device-connected sysfs prop./fix pinctrl read bug
Device-connected sysfs property is vulnerable for simultanious access by
IRQ handler and sysfs property show handler.

Fix bug causing kernel stack-dump/crash when trying to read current pinctrl state through sysfs property
2020-10-08 20:06:40 +02:00
Steinar Bakkemo 914d0eaeb4 otgcontrol: improve device OTG control mode handling/authentication handling
Temporary skip  authentication of calling application

Check connection state before changing state (to keep connection state while
changing mode).

Other cleanup
2020-10-08 20:06:40 +02:00
Steinar Bakkemo 658de5096b otgcontrol: add synchronization helpers for synchronization of flags
Add synchronization to one_wire_gpio_irq_is_handling flag checked and
set by GPIO IRQ handler and reset by GPIO IRQ worker.
2020-10-08 20:06:39 +02:00
Steinar Bakkemo a43aaee241 otgcontrol: move pdata properties from otgc_data to otgc_data->pdata structure 2020-10-08 20:06:30 +02:00
Steinar Bakkemo d6cdbfc9bb otgcontrol: adjust to 8 char tab width and squeeze code within 80 chars, dyndbg
Convert printk's to dev_dbg.

Fix tabs (8 chars) and wrap lines to fit within 80 chars, according to kernel
standards.
2020-10-08 20:03:39 +02:00
Steinar Bakkemo 7e2599d4fb otgcontrol: improve pdata initialization and probe defer/unallocation sequence 2020-10-08 19:52:42 +02:00
Steinar Bakkemo a7a96a0a46 otgcontrol: clean up uninitialize code in driver probe 2020-10-08 19:49:55 +02:00
Steinar Bakkemo de8d0dd5c8 otgcontrol: improve ow/pogo IRQ handling (500 ms debounce/filter), bugfix
Fix bug caused by calling wrong method when trying to switch USB OTG DR mode
2020-10-08 19:49:42 +02:00
Steinar Bakkemo 2833df5aa4 otgcontrol: implement initial FSM
Complete disabling of authenticated USB device connection in all modes

Code cleanup
- Spaces -> tabs
- Cleaner initiation sequence
2020-10-08 19:46:24 +02:00
Steinar Bakkemo e353de030a otgcontrol: add one-wire gpio irq handling
- Fix typo in devicetree causing pincontrol not being registered
- Change pin mux states to use both RX and TX pin
- Implement preliminary first attempt to communicate over ow (wip)
- Add registration as extcon device
- Add ow tty property in device-tree
- Add ow gpio property in device-tree
- Add GPIO IRQ initiation/hanndling in delayed worker
2020-10-08 19:27:33 +02:00
Steinar Bakkemo fac945efde otgcontrol: add excton device registration (emulate OTG VID signal -> OTG driver) 2020-10-08 19:25:40 +02:00
Steinar Bakkemo 5279a775da otgcontrol: rm-otgcontrol driver initial commit 2020-10-08 18:30:57 +02:00