Re: [PATCH v8 2/7] usb: mux: add generic code for dual role port mux

From: Lu Baolu
Date: Fri May 27 2016 - 04:08:26 EST


Hi,

On 05/27/2016 04:00 PM, Heikki Krogerus wrote:
>> I agree with you that we should move extcon out of the framework.
>> >
>> > In order to support multiport systems, I have below proposal.
>> >
>> > Currently, we have below interfaces.
>> >
>> > struct portmux_dev *portmux_register(struct portmux_desc *desc);
>> > void portmux_unregister(struct portmux_dev *pdev);
>> >
>> > I will add below ones.
>> >
>> > struct portmux_dev *portmux_lookup_by_name(char *name);
>> > int portmux_switch(struct portmux_dev *pdev, enum port_role);
>> >
>> > The normal usage mode is
>> > 1) the mux device is registered as soon as a mux is detected with
>> > portmux_register();
>> > 2) In components like USB PHY or changer drivers, the mux could
>> > be retrieved with portmux_lookup_by_name() and controlled via
>> > portmux_switch().
>> >
>> > Is this helpful?
> It works for me, and we can improve it later if needed.

Okay, thanks.

Best regards,
Lu Baolu