Linux USB
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Wentong Wu <wentong.wu@intel.com>,
	gregkh@linuxfoundation.org, arnd@arndb.de, mka@chromium.org,
	oneukum@suse.com, lee@kernel.org, wsa@kernel.org,
	kfting@nuvoton.com, broonie@kernel.org, linus.walleij@linaro.org,
	maz@kernel.org, brgl@bgdev.pl, linux-usb@vger.kernel.org,
	linux-i2c@vger.kernel.org, linux-spi@vger.kernel.org,
	linux-gpio@vger.kernel.org, andriy.shevchenko@linux.intel.com,
	heikki.krogerus@linux.intel.com, andi.shyti@linux.intel.com,
	sakari.ailus@linux.intel.com, bartosz.golaszewski@linaro.org,
	srinivas.pandruvada@intel.com
Cc: zhifeng.wang@intel.com
Subject: Re: [PATCH v14 1/4] usb: Add support for Intel LJCA device
Date: Mon, 4 Sep 2023 09:45:23 +0200	[thread overview]
Message-ID: <e1da8a5d-ec73-7ff4-d147-c50aa44f1039@redhat.com> (raw)
In-Reply-To: <1693806261-12958-2-git-send-email-wentong.wu@intel.com>

Hi,

On 9/4/23 07:44, Wentong Wu wrote:
> Implements the USB part of Intel USB-I2C/GPIO/SPI adapter device
> named "La Jolla Cove Adapter" (LJCA).
> 
> The communication between the various LJCA module drivers and the
> hardware will be muxed/demuxed by this driver. Three modules (
> I2C, GPIO, and SPI) are supported currently.
> 
> Each sub-module of LJCA device is identified by type field within
> the LJCA message header.
> 
> The sub-modules of LJCA can use ljca_transfer() to issue a transfer
> between host and hardware. And ljca_register_event_cb is exported
> to LJCA sub-module drivers for hardware event subscription.
> 
> The minimum code in ASL that covers this board is
> Scope (\_SB.PCI0.DWC3.RHUB.HS01)
>     {
>         Device (GPIO)
>         {
>             Name (_ADR, Zero)
>             Name (_STA, 0x0F)
>         }
> 
>         Device (I2C)
>         {
>             Name (_ADR, One)
>             Name (_STA, 0x0F)
>         }
> 
>         Device (SPI)
>         {
>             Name (_ADR, 0x02)
>             Name (_STA, 0x0F)
>         }
>     }
> 
> Signed-off-by: Wentong Wu <wentong.wu@intel.com>
> Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
> Tested-by: Hans de Goede <hdegoede@redhat.com>
> ---

<snip>

> +#ifdef CONFIG_ACPI
> +struct ljca_match_ids_walk_data {
> +	const struct acpi_device_id *ids;
> +	const char *uid;
> +	struct acpi_device *adev;
> +};
> +
> +static const struct acpi_device_id ljca_gpio_hids[] = {
> +	{ "INTC1074" },
> +	{ "INTC1096" },
> +	{ "INTC100B" },
> +	{ "INTC10D1" },
> +	{},
> +};
> +
> +static const struct acpi_device_id ljca_i2c_hids[] = {
> +	{ "INTC1075" },
> +	{ "INTC1097" },
> +	{ "INTC100C" },
> +	{ "INTC10D2" },
> +	{},
> +};
> +
> +static const struct acpi_device_id ljca_spi_hids[] = {
> +	{ "INTC1091" },
> +	{ "INTC1098" },
> +	{ "INTC100D" },
> +	{ "INTC10D3" },
> +	{},
> +};
> +
> +static int ljca_match_device_ids(struct acpi_device *adev, void *data)
> +{
> +	struct ljca_match_ids_walk_data *wd = data;
> +	const char *uid = acpi_device_uid(adev);
> +
> +	if (acpi_match_device_ids(adev, wd->ids))
> +		return 0;
> +
> +	if (!wd->uid)
> +		goto match;
> +
> +	if (!uid)
> +		uid = "0";
> +	else
> +		uid = memchr(uid, wd->uid[0], strlen(uid));

Note this line can be simplified to:

		uid = strchr(uid, wd->uid[0]);

Regards,

Hans


  reply	other threads:[~2023-09-04  7:46 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-04  5:44 [PATCH v14 0/4] Add Intel LJCA device driver Wentong Wu
2023-09-04  5:44 ` [PATCH v14 1/4] usb: Add support for Intel LJCA device Wentong Wu
2023-09-04  7:45   ` Hans de Goede [this message]
2023-09-04  7:52     ` Wu, Wentong
2023-09-04 10:33   ` Oliver Neukum
2023-09-04 13:52     ` Wu, Wentong
2023-09-04 14:06       ` Oliver Neukum
2023-09-05  2:20         ` Wu, Wentong
2023-09-05  8:46           ` Oliver Neukum
2023-09-05  8:53             ` Wu, Wentong
2023-09-05 10:04               ` gregkh
2023-09-06  3:29                 ` Wu, Wentong
2023-09-04  5:44 ` [PATCH v14 2/4] i2c: Add support for Intel LJCA USB I2C driver Wentong Wu
2023-09-04  5:44 ` [PATCH v14 3/4] spi: Add support for Intel LJCA USB SPI driver Wentong Wu
2023-09-04  5:44 ` [PATCH v14 4/4] gpio: update Intel LJCA USB GPIO driver Wentong Wu
2023-09-04  7:38 ` [PATCH v14 0/4] Add Intel LJCA device driver Bartosz Golaszewski
2023-09-04  8:25   ` Wu, Wentong
2023-09-04  7:44 ` Hans de Goede
2023-09-04  7:56   ` Wu, Wentong

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=e1da8a5d-ec73-7ff4-d147-c50aa44f1039@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=andi.shyti@linux.intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=brgl@bgdev.pl \
    --cc=broonie@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=kfting@nuvoton.com \
    --cc=lee@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=mka@chromium.org \
    --cc=oneukum@suse.com \
    --cc=sakari.ailus@linux.intel.com \
    --cc=srinivas.pandruvada@intel.com \
    --cc=wentong.wu@intel.com \
    --cc=wsa@kernel.org \
    --cc=zhifeng.wang@intel.com \
    /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