From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org, git@amd.com
Subject: Re: [PATCH 3/3] usb: typec: tipd: name TPS_REG_POWER_STATUS field masks
Date: Mon, 18 May 2026 13:34:18 +0300 [thread overview]
Message-ID: <agrrKmF53AVhdbgP@kuha> (raw)
In-Reply-To: <20260513182850.165349-4-radhey.shyam.pandey@amd.com>
On Wed, May 13, 2026 at 11:58:50PM +0530, Radhey Shyam Pandey wrote:
> Define named masks for Power Status fields (connection and source/sink)
> and reuse them consistently for both field extraction and value
> construction. This avoids raw bit usage, keeps the definitions aligned.
> No functional change.
>
> Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
> drivers/usb/typec/tipd/tps6598x.h | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/usb/typec/tipd/tps6598x.h b/drivers/usb/typec/tipd/tps6598x.h
> index 03edbb77bbd6..d4140f4da5bb 100644
> --- a/drivers/usb/typec/tipd/tps6598x.h
> +++ b/drivers/usb/typec/tipd/tps6598x.h
> @@ -142,9 +142,13 @@
> #define TPS_SYSTEM_POWER_STATE_S4 0x04
> #define TPS_SYSTEM_POWER_STATE_S5 0x05
>
> -/* TPS_REG_POWER_STATUS bits */
> -#define TPS_POWER_STATUS_CONNECTION(x) TPS_FIELD_GET(BIT(0), (x))
> -#define TPS_POWER_STATUS_SOURCESINK(x) TPS_FIELD_GET(BIT(1), (x))
> +/* TPS_REG_POWER_STATUS bits (masks shared by TPS_FIELD_GET accessors and FIELD_PREP) */
> +#define TPS_POWER_STATUS_CONNECTION_MASK BIT(0)
> +#define TPS_POWER_STATUS_SOURCESINK_MASK BIT(1)
> +#define TPS_POWER_STATUS_CONNECTION(x) \
> + TPS_FIELD_GET(TPS_POWER_STATUS_CONNECTION_MASK, (x))
> +#define TPS_POWER_STATUS_SOURCESINK(x) \
> + TPS_FIELD_GET(TPS_POWER_STATUS_SOURCESINK_MASK, (x))
> #define TPS_POWER_STATUS_BC12_DET(x) TPS_FIELD_GET(BIT(2), (x))
>
> #define TPS_POWER_STATUS_TYPEC_CURRENT_MASK GENMASK(3, 2)
> --
> 2.44.4
--
heikki
prev parent reply other threads:[~2026-05-18 10:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-13 18:28 [PATCH 0/3] usb: typec: tipd: improve probe diagnostics and POWER_STATUS handling Radhey Shyam Pandey
2026-05-13 18:28 ` [PATCH 1/3] usb: typec: tipd: add error message for vendor ID read failure Radhey Shyam Pandey
2026-05-18 10:19 ` Heikki Krogerus
2026-05-18 15:53 ` Pandey, Radhey Shyam
2026-05-19 13:54 ` Heikki Krogerus
2026-05-19 16:23 ` Pandey, Radhey Shyam
2026-05-13 18:28 ` [PATCH 2/3] usb: typec: tipd: demote missing IRQ log to info for polling mode Radhey Shyam Pandey
2026-05-18 10:26 ` Heikki Krogerus
2026-05-18 15:56 ` Pandey, Radhey Shyam
2026-05-13 18:28 ` [PATCH 3/3] usb: typec: tipd: name TPS_REG_POWER_STATUS field masks Radhey Shyam Pandey
2026-05-18 10:34 ` Heikki Krogerus [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=agrrKmF53AVhdbgP@kuha \
--to=heikki.krogerus@linux.intel.com \
--cc=git@amd.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=radhey.shyam.pandey@amd.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.