mbox series

[0/2] extcon: axp288: Move to swnodes

Message ID 20191001105138.73036-1-heikki.krogerus@linux.intel.com (mailing list archive)
Headers show
Series extcon: axp288: Move to swnodes | expand

Message

Heikki Krogerus Oct. 1, 2019, 10:51 a.m. UTC
Hi Hans,

That AXP288 extcon driver is the last that uses build-in connection
description. I'm replacing it with a code that finds the role mux
software node instead.

I'm proposing also here a little helper
usb_role_switch_find_by_fwnode() that uses
class_find_device_by_fwnode() to find the role switches.

thanks,

Heikki Krogerus (2):
  usb: roles: Add usb_role_switch_find_by_fwnode()
  extcon: axp288: Remove the build-in connection description

 drivers/extcon/extcon-axp288.c | 38 ++++++++++++++++++++--------------
 drivers/usb/roles/class.c      | 21 +++++++++++++++++++
 include/linux/usb/role.h       |  3 +++
 3 files changed, 47 insertions(+), 15 deletions(-)

Comments

Hans de Goede Oct. 6, 2019, 7:37 p.m. UTC | #1
Hi,

On 01-10-2019 12:51, Heikki Krogerus wrote:
> Hi Hans,
> 
> That AXP288 extcon driver is the last that uses build-in connection
> description. I'm replacing it with a code that finds the role mux
> software node instead.
> 
> I'm proposing also here a little helper
> usb_role_switch_find_by_fwnode() that uses
> class_find_device_by_fwnode() to find the role switches.

I'm building a kernel with these patches to test them now
(on hw which uses the axp288 extcon code-paths with the role-sw)

No test results yet, but I did notice this will building:

   CC [M]  drivers/extcon/extcon-axp288.o
drivers/extcon/extcon-axp288.c: In function ‘axp288_extcon_find_role_sw’:
drivers/extcon/extcon-axp288.c:333:9: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
   333 |  swnode = software_node_find_by_name(NULL, "intel-xhci-usb-sw");
       |         ^

Regards,

Hans
Heikki Krogerus Oct. 8, 2019, 11:15 a.m. UTC | #2
On Sun, Oct 06, 2019 at 09:37:25PM +0200, Hans de Goede wrote:
> Hi,
> 
> On 01-10-2019 12:51, Heikki Krogerus wrote:
> > Hi Hans,
> > 
> > That AXP288 extcon driver is the last that uses build-in connection
> > description. I'm replacing it with a code that finds the role mux
> > software node instead.
> > 
> > I'm proposing also here a little helper
> > usb_role_switch_find_by_fwnode() that uses
> > class_find_device_by_fwnode() to find the role switches.
> 
> I'm building a kernel with these patches to test them now
> (on hw which uses the axp288 extcon code-paths with the role-sw)
> 
> No test results yet, but I did notice this will building:
> 
>   CC [M]  drivers/extcon/extcon-axp288.o
> drivers/extcon/extcon-axp288.c: In function ‘axp288_extcon_find_role_sw’:
> drivers/extcon/extcon-axp288.c:333:9: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
>   333 |  swnode = software_node_find_by_name(NULL, "intel-xhci-usb-sw");
>       |         ^

Thanks Hans. I'll fix that.

Br,