Skip to content

Commit 2cf39b8

Browse files
committed
hwmon: (xgene) Migrate to use generic PCC shmem related macros
Use the newly defined common and generic PCC shared memory region related macros in this driver to replace the locally defined ones. Cc: Jean Delvare <[email protected]> Acked-by: Guenter Roeck <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sudeep Holla <[email protected]>
1 parent 89a4ad1 commit 2cf39b8

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

drivers/hwmon/xgene-hwmon.c

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,6 @@
5757
(MSG_TYPE_SET(MSG_TYPE_PWRMGMT) | \
5858
MSG_SUBTYPE_SET(hndl) | TPC_CMD_SET(cmd) | type)
5959

60-
/* PCC defines */
61-
#define PCC_SIGNATURE_MASK 0x50424300
62-
#define PCCC_GENERATE_DB_INT BIT(15)
63-
#define PCCS_CMD_COMPLETE BIT(0)
64-
#define PCCS_SCI_DOORBEL BIT(1)
65-
#define PCCS_PLATFORM_NOTIFICATION BIT(3)
6660
/*
6761
* Arbitrary retries in case the remote processor is slow to respond
6862
* to PCC commands
@@ -142,15 +136,15 @@ static int xgene_hwmon_pcc_rd(struct xgene_hwmon_dev *ctx, u32 *msg)
142136

143137
/* Write signature for subspace */
144138
WRITE_ONCE(generic_comm_base->signature,
145-
cpu_to_le32(PCC_SIGNATURE_MASK | ctx->mbox_idx));
139+
cpu_to_le32(PCC_SIGNATURE | ctx->mbox_idx));
146140

147141
/* Write to the shared command region */
148142
WRITE_ONCE(generic_comm_base->command,
149-
cpu_to_le16(MSG_TYPE(msg[0]) | PCCC_GENERATE_DB_INT));
143+
cpu_to_le16(MSG_TYPE(msg[0]) | PCC_CMD_GENERATE_DB_INTR));
150144

151145
/* Flip CMD COMPLETE bit */
152146
val = le16_to_cpu(READ_ONCE(generic_comm_base->status));
153-
val &= ~PCCS_CMD_COMPLETE;
147+
val &= ~PCC_STATUS_CMD_COMPLETE;
154148
WRITE_ONCE(generic_comm_base->status, cpu_to_le16(val));
155149

156150
/* Copy the message to the PCC comm space */
@@ -544,7 +538,7 @@ static void xgene_hwmon_pcc_rx_cb(struct mbox_client *cl, void *msg)
544538
msg = generic_comm_base + 1;
545539
/* Check if platform sends interrupt */
546540
if (!xgene_word_tst_and_clr(&generic_comm_base->status,
547-
PCCS_SCI_DOORBEL))
541+
PCC_STATUS_SCI_DOORBELL))
548542
return;
549543

550544
/*
@@ -566,7 +560,7 @@ static void xgene_hwmon_pcc_rx_cb(struct mbox_client *cl, void *msg)
566560
TPC_CMD(((u32 *)msg)[0]) == TPC_ALARM))) {
567561
/* Check if platform completes command */
568562
if (xgene_word_tst_and_clr(&generic_comm_base->status,
569-
PCCS_CMD_COMPLETE)) {
563+
PCC_STATUS_CMD_COMPLETE)) {
570564
ctx->sync_msg.msg = ((u32 *)msg)[0];
571565
ctx->sync_msg.param1 = ((u32 *)msg)[1];
572566
ctx->sync_msg.param2 = ((u32 *)msg)[2];

0 commit comments

Comments
 (0)