Skip to content

Commit 014730c

Browse files
basuamdJiri Kosina
authored andcommitted
HID: amd_sfh: Move interrupt handling to common interface
Interrupt handling can be used in multiple files to support all AMD SOCs. Hence move interrupt handling to common interface. Signed-off-by: Basavaraj Natikar <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent e7f535e commit 014730c

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

drivers/hid/amd-sfh-hid/amd_sfh_client.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,7 @@ static void amd_sfh_resume(struct amd_mp2_dev *mp2)
178178
}
179179

180180
schedule_delayed_work(&cl_data->work_buffer, msecs_to_jiffies(AMD_SFH_IDLE_LOOP));
181-
if (mp2->mp2_ops->clear_intr)
182-
mp2->mp2_ops->clear_intr(mp2);
181+
amd_sfh_clear_intr(mp2);
183182
}
184183

185184
static void amd_sfh_suspend(struct amd_mp2_dev *mp2)
@@ -202,8 +201,7 @@ static void amd_sfh_suspend(struct amd_mp2_dev *mp2)
202201
}
203202

204203
cancel_delayed_work_sync(&cl_data->work_buffer);
205-
if (mp2->mp2_ops->clear_intr)
206-
mp2->mp2_ops->clear_intr(mp2);
204+
amd_sfh_clear_intr(mp2);
207205
}
208206

209207
int amd_sfh_hid_client_init(struct amd_mp2_dev *privdata)

drivers/hid/amd-sfh-hid/amd_sfh_common.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,8 @@ struct amd_mp2_ops {
6666

6767
void amd_sfh_work(struct work_struct *work);
6868
void amd_sfh_work_buffer(struct work_struct *work);
69+
void amd_sfh_clear_intr_v2(struct amd_mp2_dev *privdata);
70+
int amd_sfh_irq_init_v2(struct amd_mp2_dev *privdata);
71+
void amd_sfh_clear_intr(struct amd_mp2_dev *privdata);
72+
int amd_sfh_irq_init(struct amd_mp2_dev *privdata);
6973
#endif

drivers/hid/amd-sfh-hid/amd_sfh_pcie.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,15 @@ static void amd_stop_all_sensor_v2(struct amd_mp2_dev *privdata)
9292
writel(cmd_base.ul, privdata->mmio + AMD_C2P_MSG0);
9393
}
9494

95-
static void amd_sfh_clear_intr_v2(struct amd_mp2_dev *privdata)
95+
void amd_sfh_clear_intr_v2(struct amd_mp2_dev *privdata)
9696
{
9797
if (readl(privdata->mmio + AMD_P2C_MSG(4))) {
9898
writel(0, privdata->mmio + AMD_P2C_MSG(4));
9999
writel(0xf, privdata->mmio + AMD_P2C_MSG(5));
100100
}
101101
}
102102

103-
static void amd_sfh_clear_intr(struct amd_mp2_dev *privdata)
103+
void amd_sfh_clear_intr(struct amd_mp2_dev *privdata)
104104
{
105105
if (privdata->mp2_ops->clear_intr)
106106
privdata->mp2_ops->clear_intr(privdata);
@@ -113,7 +113,7 @@ static irqreturn_t amd_sfh_irq_handler(int irq, void *data)
113113
return IRQ_HANDLED;
114114
}
115115

116-
static int amd_sfh_irq_init_v2(struct amd_mp2_dev *privdata)
116+
int amd_sfh_irq_init_v2(struct amd_mp2_dev *privdata)
117117
{
118118
int rc;
119119

@@ -279,7 +279,7 @@ static void mp2_select_ops(struct amd_mp2_dev *privdata)
279279
}
280280
}
281281

282-
static int amd_sfh_irq_init(struct amd_mp2_dev *privdata)
282+
int amd_sfh_irq_init(struct amd_mp2_dev *privdata)
283283
{
284284
if (privdata->mp2_ops->init_intr)
285285
return privdata->mp2_ops->init_intr(privdata);

0 commit comments

Comments
 (0)