Skip to content

Commit 89a4ad1

Browse files
committed
i2c: xgene-slimpro: 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. Reviewed-by: Andi Shyti <[email protected]> Acked-by: Wolfram Sang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sudeep Holla <[email protected]>
1 parent 55d235e commit 89a4ad1

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

drivers/i2c/busses/i2c-xgene-slimpro.c

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,6 @@
9191

9292
#define SLIMPRO_IIC_MSG_DWORD_COUNT 3
9393

94-
/* PCC related defines */
95-
#define PCC_SIGNATURE 0x50424300
96-
#define PCC_STS_CMD_COMPLETE BIT(0)
97-
#define PCC_STS_SCI_DOORBELL BIT(1)
98-
#define PCC_STS_ERR BIT(2)
99-
#define PCC_STS_PLAT_NOTIFY BIT(3)
100-
#define PCC_CMD_GENERATE_DB_INT BIT(15)
101-
10294
struct slimpro_i2c_dev {
10395
struct i2c_adapter adapter;
10496
struct device *dev;
@@ -160,11 +152,11 @@ static void slimpro_i2c_pcc_rx_cb(struct mbox_client *cl, void *msg)
160152

161153
/* Check if platform sends interrupt */
162154
if (!xgene_word_tst_and_clr(&generic_comm_base->status,
163-
PCC_STS_SCI_DOORBELL))
155+
PCC_STATUS_SCI_DOORBELL))
164156
return;
165157

166158
if (xgene_word_tst_and_clr(&generic_comm_base->status,
167-
PCC_STS_CMD_COMPLETE)) {
159+
PCC_STATUS_CMD_COMPLETE)) {
168160
msg = generic_comm_base + 1;
169161

170162
/* Response message msg[1] contains the return value. */
@@ -186,10 +178,10 @@ static void slimpro_i2c_pcc_tx_prepare(struct slimpro_i2c_dev *ctx, u32 *msg)
186178
cpu_to_le32(PCC_SIGNATURE | ctx->mbox_idx));
187179

188180
WRITE_ONCE(generic_comm_base->command,
189-
cpu_to_le16(SLIMPRO_MSG_TYPE(msg[0]) | PCC_CMD_GENERATE_DB_INT));
181+
cpu_to_le16(SLIMPRO_MSG_TYPE(msg[0]) | PCC_CMD_GENERATE_DB_INTR));
190182

191183
status = le16_to_cpu(READ_ONCE(generic_comm_base->status));
192-
status &= ~PCC_STS_CMD_COMPLETE;
184+
status &= ~PCC_STATUS_CMD_COMPLETE;
193185
WRITE_ONCE(generic_comm_base->status, cpu_to_le16(status));
194186

195187
/* Copy the message to the PCC comm space */

0 commit comments

Comments
 (0)