linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Hans de Goede <hdegoede@redhat.com>
Cc: "Rafael J . Wysocki" <rafael@kernel.org>,
	"Len Brown" <lenb@kernel.org>,
	"ACPI Devel Maling List" <linux-acpi@vger.kernel.org>,
	"Stephan Gerhold" <stephan@gerhold.net>,
	linux-serial@vger.kernel.org,
	"Frédéric Danis" <frederic.danis.oss@gmail.com>
Subject: Re: [PATCH] ACPI / scan: Create platform device for BCM4752 and LNV4752 ACPI nodes
Date: Thu, 30 Dec 2021 17:36:45 +0100	[thread overview]
Message-ID: <CAJZ5v0goKmkTwr25FB7EX0kqpO6BdBL12M3hcqrAxS8u9UaLAg@mail.gmail.com> (raw)
In-Reply-To: <20211230115747.15302-1-hdegoede@redhat.com>

On Thu, Dec 30, 2021 at 12:57 PM Hans de Goede <hdegoede@redhat.com> wrote:
>
> BCM4752 and LNV4752 ACPI nodes describe a Broadcom 4752 GPS module
> attached to an UART of the system.
>
> The GPS modules talk a custom protocol which only works with a closed-
> source Android gpsd daemon which knows this protocol.
>
> The ACPI nodes also describe GPIOs to turn the GPS on/off these are
> handled by the net/rfkill/rfkill-gpio.c code. This handling predates the
> addition of enumeration of ACPI instantiated serdevs to the kernel and
> was broken by that addition, because the ACPI scan code now no longer
> instantiates platform_device-s for these nodes.
>
> Rename the i2c_multi_instantiate_ids HID list to ignore_serial_bus_ids
> and add the BCM4752 and LNV4752 HIDs, so that rfkill-gpio gets
> a platform_device to bind to again; and so that a tty cdev for gpsd
> gets created for these.
>
> Fixes: e361d1f85855 ("ACPI / scan: Fix enumeration for special UART devices")
> Cc: Frédéric Danis <frederic.danis.oss@gmail.com>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> Note there is some work on reverse-engineering the protocol for these
> GPS modules here, but this is not complete:
> https://redmine.replicant.us/projects/replicant/wiki/BCM4751
> https://git.replicant.us/contrib/PaulK/bcm4751/
> ---
>  drivers/acpi/scan.c | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
> index 526e823a33fb..c5dfbe26a0cb 100644
> --- a/drivers/acpi/scan.c
> +++ b/drivers/acpi/scan.c
> @@ -1701,6 +1701,7 @@ static bool acpi_device_enumeration_by_parent(struct acpi_device *device)
>  {
>         struct list_head resource_list;
>         bool is_serial_bus_slave = false;
> +       static const struct acpi_device_id ignore_serial_bus_ids[] = {
>         /*
>          * These devices have multiple I2cSerialBus resources and an i2c-client
>          * must be instantiated for each, each with its own i2c_device_id.
> @@ -1709,11 +1710,18 @@ static bool acpi_device_enumeration_by_parent(struct acpi_device *device)
>          * drivers/platform/x86/i2c-multi-instantiate.c driver, which knows
>          * which i2c_device_id to use for each resource.
>          */
> -       static const struct acpi_device_id i2c_multi_instantiate_ids[] = {
>                 {"BSG1160", },
>                 {"BSG2150", },
>                 {"INT33FE", },
>                 {"INT3515", },
> +       /*
> +        * HIDs of device with an UartSerialBusV2 resource for which userspace
> +        * expects a regular tty cdev to be created (instead of the in kernel
> +        * serdev) and which have a kernel driver which expects a platform_dev
> +        * such as the rfkill-gpio driver.
> +        */
> +               {"BCM4752", },
> +               {"LNV4752", },
>                 {}
>         };
>
> @@ -1727,8 +1735,7 @@ static bool acpi_device_enumeration_by_parent(struct acpi_device *device)
>              fwnode_property_present(&device->fwnode, "baud")))
>                 return true;
>
> -       /* Instantiate a pdev for the i2c-multi-instantiate drv to bind to */
> -       if (!acpi_match_device_ids(device, i2c_multi_instantiate_ids))
> +       if (!acpi_match_device_ids(device, ignore_serial_bus_ids))
>                 return false;
>
>         INIT_LIST_HEAD(&resource_list);
> --

Applied as 5.17 material, thanks!

      reply	other threads:[~2021-12-30 16:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-30 11:57 [PATCH] ACPI / scan: Create platform device for BCM4752 and LNV4752 ACPI nodes Hans de Goede
2021-12-30 16:36 ` Rafael J. Wysocki [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJZ5v0goKmkTwr25FB7EX0kqpO6BdBL12M3hcqrAxS8u9UaLAg@mail.gmail.com \
    --to=rafael@kernel.org \
    --cc=frederic.danis.oss@gmail.com \
    --cc=hdegoede@redhat.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=stephan@gerhold.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).