mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: "Christian A. Ehrhardt" <lk@c--e.de>
Cc: linux-kernel@vger.kernel.org,
	"Dmitry Baryshkov" <dmitry.baryshkov@linaro.org>,
	"Diogo Ivo" <diogo.ivo@tecnico.ulisboa.pt>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Prashant Malani" <pmalani@chromium.org>,
	"Jameson Thies" <jthies@google.com>,
	"Abhishek Pandit-Subedi" <abhishekpandit@chromium.org>,
	"Neil Armstrong" <neil.armstrong@linaro.org>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Samuel Čavoj" <samuel@cavoj.net>,
	linux-usb@vger.kernel.org
Subject: Re: [PATCH 1/3] usb: typec: ucsi: Stop abuse of bit definitions from ucsi.h
Date: Wed, 3 Apr 2024 13:39:44 +0300	[thread overview]
Message-ID: <Zg0x8HKsoJb+phWw@kuha.fi.intel.com> (raw)
In-Reply-To: <20240327224554.1772525-2-lk@c--e.de>

On Wed, Mar 27, 2024 at 11:45:52PM +0100, Christian A. Ehrhardt wrote:
> In ucsi.h there are flag definitions for the ->flags field
> in struct ucsi. Some implementations abuse these bits for
> their private ->flags fields e.g. in struct ucsi_acpi.
> 
> Move the definitions into the backend implementations that
> still need them. While there fix one instance where the flag
> name was not converted in a previous change.
> 
> No semantic change intended.
> 
> Signed-off-by: Christian A. Ehrhardt <lk@c--e.de>

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
>  drivers/usb/typec/ucsi/ucsi.h         | 2 --
>  drivers/usb/typec/ucsi/ucsi_acpi.c    | 3 ++-
>  drivers/usb/typec/ucsi/ucsi_stm32g0.c | 1 +
>  3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/typec/ucsi/ucsi.h b/drivers/usb/typec/ucsi/ucsi.h
> index 0e7c92eb1b22..591f734d457b 100644
> --- a/drivers/usb/typec/ucsi/ucsi.h
> +++ b/drivers/usb/typec/ucsi/ucsi.h
> @@ -403,8 +403,6 @@ struct ucsi {
>  	/* PPM communication flags */
>  	unsigned long flags;
>  #define EVENT_PENDING	0
> -#define COMMAND_PENDING	1
> -#define ACK_PENDING	2
>  
>  	unsigned long quirks;
>  #define UCSI_NO_PARTNER_PDOS	BIT(0)	/* Don't read partner's PDOs */
> diff --git a/drivers/usb/typec/ucsi/ucsi_acpi.c b/drivers/usb/typec/ucsi/ucsi_acpi.c
> index 7b3ac133ef86..cc03a49c589c 100644
> --- a/drivers/usb/typec/ucsi/ucsi_acpi.c
> +++ b/drivers/usb/typec/ucsi/ucsi_acpi.c
> @@ -203,7 +203,8 @@ static void ucsi_acpi_notify(acpi_handle handle, u32 event, void *data)
>  	    !test_bit(UCSI_ACPI_SUPPRESS_EVENT, &ua->flags))
>  		ucsi_connector_change(ua->ucsi, UCSI_CCI_CONNECTOR(cci));
>  
> -	if (cci & UCSI_CCI_ACK_COMPLETE && test_bit(ACK_PENDING, &ua->flags))
> +	if (cci & UCSI_CCI_ACK_COMPLETE &&
> +	    test_bit(UCSI_ACPI_ACK_PENDING, &ua->flags))
>  		complete(&ua->complete);
>  	if (cci & UCSI_CCI_COMMAND_COMPLETE &&
>  	    test_bit(UCSI_ACPI_COMMAND_PENDING, &ua->flags))
> diff --git a/drivers/usb/typec/ucsi/ucsi_stm32g0.c b/drivers/usb/typec/ucsi/ucsi_stm32g0.c
> index 93d7806681cf..ac48b7763114 100644
> --- a/drivers/usb/typec/ucsi/ucsi_stm32g0.c
> +++ b/drivers/usb/typec/ucsi/ucsi_stm32g0.c
> @@ -64,6 +64,7 @@ struct ucsi_stm32g0 {
>  	struct completion complete;
>  	struct device *dev;
>  	unsigned long flags;
> +#define COMMAND_PENDING	1
>  	const char *fw_name;
>  	struct ucsi *ucsi;
>  	bool suspended;
> -- 
> 2.40.1

-- 
heikki

  reply	other threads:[~2024-04-03 10:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-27 22:45 [PATCH 0/3] usb: typec: ucsi: Ack connector change early Christian A. Ehrhardt
2024-03-27 22:45 ` [PATCH 1/3] usb: typec: ucsi: Stop abuse of bit definitions from ucsi.h Christian A. Ehrhardt
2024-04-03 10:39   ` Heikki Krogerus [this message]
2024-03-27 22:45 ` [PATCH 2/3] usb: typec: ucsi: Never send a lone connector change ack Christian A. Ehrhardt
2024-04-03 10:40   ` Heikki Krogerus
2024-03-27 22:45 ` [PATCH 3/3] usb: typec: ucsi_acpi: Remove Dell quirk Christian A. Ehrhardt
2024-04-03 10:40   ` Heikki Krogerus
2024-03-29  5:56 ` [PATCH 0/3] usb: typec: ucsi: Ack connector change early Dmitry Baryshkov

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=Zg0x8HKsoJb+phWw@kuha.fi.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=abhishekpandit@chromium.org \
    --cc=diogo.ivo@tecnico.ulisboa.pt \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jthies@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=lk@c--e.de \
    --cc=neil.armstrong@linaro.org \
    --cc=pmalani@chromium.org \
    --cc=samuel@cavoj.net \
    --cc=u.kleine-koenig@pengutronix.de \
    /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

all inboxes | Powered by JetHome®