Skip to contentSkip to conversation

usb: typec: Generalize mux mode names

RFC New Heikki Krogerus 1 participant 1 message May 8, 2018 USB

lore
Share & tools
lore
#0 lore raw

RFC 1/7 usb: typec: Generalize mux mode names

Hi,

Quoted 11 lines · Mats Karrman
Quoted 10 lines
Quoted 5 lines

Even so, when the mux driver "set" function is called, it will just get the mode argument but since the mode (TYPEC_STATE_...) is overlapping for different AMs if I understand your proposal correctly, the mux also needs to know what AM is active.
Does this imply that the mux set function signature need to change?

My plan was actually to propose we get rid of the current mux handling (just leave the orientation switch) in favour of the notifications I'm introducing with the type-c bus for the alternate modes. The current mux handling is definitely not enough, and does not work in every scenario, like also you pointed out.

Quoted 5 lines

So, the mux need to subscribe to each svid:mode pair it is interested in using typec_altmode_register_notifier() and then use those callbacks to switch the correct signals to the connector. And a driver for an off-the-shelf mux device could have the translation between svid:mode pairs and mux device specific control specified by of/acpi properties. Right?

Yes. That is the plan. Would it work for you?

Thanks,