mbox series

[v5,0/5] acpi: Store _PLD information and convert users

Message ID 20211223081620.45479-1-heikki.krogerus@linux.intel.com
Headers show
Series acpi: Store _PLD information and convert users | expand

Message

Heikki Krogerus Dec. 23, 2021, 8:16 a.m. UTC
Hi,

The last version (v4) was not properly cleaned up. Should be now OK.


v4 cover letter:

Now only storing the crc hash to a new member in struct acpi_device,
just like proposed by Rafael. In port-mapper.c I'm then scanning the
acpi bus separately with every port in order to find the matching
devices.


v3 cover letter:

The _PLD buffer is no longer stored as requested by Rafael, so the
drivers will need to continue to evaluate the _PLD if they need it.

The stored locations will therefore only contain the list of other
devices that share the location, but that is most important, and in
practice the main goal of the series in any case.


v2 cover letter:

I'm now using the helpers device_match_acpi_dev() and
device_match_fwnode() like Andy suggested. No other changes.


The original cover letter:

This removes the need for the drivers to always separately evaluate
the _PLD. With the USB Type-C connector and USB port mapping this
allows us to start using the component framework and remove the custom
APIs.

So far the only users of the _PLD information have been the USB
drivers, but it seems it will be used also at least in some camera
drivers later. These nevertheless touch mostly USB drivers.

thanks,

Heikki Krogerus (5):
  acpi: Export acpi_bus_type
  acpi: Store CRC-32 hash of the _PLD in struct acpi_device
  usb: Link the ports to the connectors they are attached to
  usb: typec: port-mapper: Convert to the component framework
  usb: Remove usb_for_each_port()

 Documentation/ABI/testing/sysfs-bus-usb |   9 +
 drivers/acpi/bus.c                      |   1 +
 drivers/acpi/scan.c                     |  16 ++
 drivers/usb/core/port.c                 |  32 +++
 drivers/usb/core/usb.c                  |  46 ----
 drivers/usb/typec/Makefile              |   3 +-
 drivers/usb/typec/class.c               |   2 -
 drivers/usb/typec/class.h               |  10 +-
 drivers/usb/typec/port-mapper.c         | 279 ++++--------------------
 include/acpi/acpi_bus.h                 |   1 +
 include/linux/usb.h                     |   9 -
 include/linux/usb/typec.h               |  12 -
 12 files changed, 105 insertions(+), 315 deletions(-)

Comments

Rafael J. Wysocki Dec. 27, 2021, 4:18 p.m. UTC | #1
On Thu, Dec 23, 2021 at 9:16 AM Heikki Krogerus
<heikki.krogerus@linux.intel.com> wrote:
>
> Hi,
>
> The last version (v4) was not properly cleaned up. Should be now OK.

It looks good to me, so

Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

for the ACPI-related changes in this series and please feel free to
route it through the USB tree if that's preferred.

Thanks!

> v4 cover letter:
>
> Now only storing the crc hash to a new member in struct acpi_device,
> just like proposed by Rafael. In port-mapper.c I'm then scanning the
> acpi bus separately with every port in order to find the matching
> devices.
>
>
> v3 cover letter:
>
> The _PLD buffer is no longer stored as requested by Rafael, so the
> drivers will need to continue to evaluate the _PLD if they need it.
>
> The stored locations will therefore only contain the list of other
> devices that share the location, but that is most important, and in
> practice the main goal of the series in any case.
>
>
> v2 cover letter:
>
> I'm now using the helpers device_match_acpi_dev() and
> device_match_fwnode() like Andy suggested. No other changes.
>
>
> The original cover letter:
>
> This removes the need for the drivers to always separately evaluate
> the _PLD. With the USB Type-C connector and USB port mapping this
> allows us to start using the component framework and remove the custom
> APIs.
>
> So far the only users of the _PLD information have been the USB
> drivers, but it seems it will be used also at least in some camera
> drivers later. These nevertheless touch mostly USB drivers.
>
> thanks,
>
> Heikki Krogerus (5):
>   acpi: Export acpi_bus_type
>   acpi: Store CRC-32 hash of the _PLD in struct acpi_device
>   usb: Link the ports to the connectors they are attached to
>   usb: typec: port-mapper: Convert to the component framework
>   usb: Remove usb_for_each_port()
>
>  Documentation/ABI/testing/sysfs-bus-usb |   9 +
>  drivers/acpi/bus.c                      |   1 +
>  drivers/acpi/scan.c                     |  16 ++
>  drivers/usb/core/port.c                 |  32 +++
>  drivers/usb/core/usb.c                  |  46 ----
>  drivers/usb/typec/Makefile              |   3 +-
>  drivers/usb/typec/class.c               |   2 -
>  drivers/usb/typec/class.h               |  10 +-
>  drivers/usb/typec/port-mapper.c         | 279 ++++--------------------
>  include/acpi/acpi_bus.h                 |   1 +
>  include/linux/usb.h                     |   9 -
>  include/linux/usb/typec.h               |  12 -
>  12 files changed, 105 insertions(+), 315 deletions(-)
>
> --
> 2.34.1
>
Greg Kroah-Hartman Dec. 30, 2021, 11:11 a.m. UTC | #2
On Mon, Dec 27, 2021 at 05:18:16PM +0100, Rafael J. Wysocki wrote:
> On Thu, Dec 23, 2021 at 9:16 AM Heikki Krogerus
> <heikki.krogerus@linux.intel.com> wrote:
> >
> > Hi,
> >
> > The last version (v4) was not properly cleaned up. Should be now OK.
> 
> It looks good to me, so
> 
> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> for the ACPI-related changes in this series and please feel free to
> route it through the USB tree if that's preferred.

Thanks, I'll take this through the USB tree now.

greg k-h