Skip to content

Commit 56f6f4c

Browse files
Bhaumik Bhattgregkh
authored andcommitted
bus: mhi: pci_generic: Apply no-op for wake using sideband wake boolean
Devices such as SDX24 do not have the provision for inband wake doorbell in the form of channel 127 and instead have a sideband GPIO for it. Newer devices such as SDX55 or SDX65 support inband wake method by default. Ensure the functionality is used based on this such that device wake stays held when a client driver uses mhi_device_get() API or the equivalent debugfs entry. Link: https://lore.kernel.org/r/1624560809-30610-1-git-send-email-bbhatt@codeaurora.org Fixes: e3e5e65 ("bus: mhi: pci_generic: No-Op for device_wake operations") Cc: stable@vger.kernel.org #5.12 Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Signed-off-by: Bhaumik Bhatt <bbhatt@codeaurora.org> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Link: https://lore.kernel.org/r/20210716075106.49938-2-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 2734d6c commit 56f6f4c

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

drivers/bus/mhi/pci_generic.c

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
* @edl: emergency download mode firmware path (if any)
3333
* @bar_num: PCI base address register to use for MHI MMIO register space
3434
* @dma_data_width: DMA transfer word size (32 or 64 bits)
35+
* @sideband_wake: Devices using dedicated sideband GPIO for wakeup instead
36+
* of inband wake support (such as sdx24)
3537
*/
3638
struct mhi_pci_dev_info {
3739
const struct mhi_controller_config *config;
@@ -40,6 +42,7 @@ struct mhi_pci_dev_info {
4042
const char *edl;
4143
unsigned int bar_num;
4244
unsigned int dma_data_width;
45+
bool sideband_wake;
4346
};
4447

4548
#define MHI_CHANNEL_CONFIG_UL(ch_num, ch_name, el_count, ev_ring) \
@@ -242,7 +245,8 @@ static const struct mhi_pci_dev_info mhi_qcom_sdx65_info = {
242245
.edl = "qcom/sdx65m/edl.mbn",
243246
.config = &modem_qcom_v1_mhiv_config,
244247
.bar_num = MHI_PCI_DEFAULT_BAR_NUM,
245-
.dma_data_width = 32
248+
.dma_data_width = 32,
249+
.sideband_wake = false,
246250
};
247251

248252
static const struct mhi_pci_dev_info mhi_qcom_sdx55_info = {
@@ -251,15 +255,17 @@ static const struct mhi_pci_dev_info mhi_qcom_sdx55_info = {
251255
.edl = "qcom/sdx55m/edl.mbn",
252256
.config = &modem_qcom_v1_mhiv_config,
253257
.bar_num = MHI_PCI_DEFAULT_BAR_NUM,
254-
.dma_data_width = 32
258+
.dma_data_width = 32,
259+
.sideband_wake = false,
255260
};
256261

257262
static const struct mhi_pci_dev_info mhi_qcom_sdx24_info = {
258263
.name = "qcom-sdx24",
259264
.edl = "qcom/prog_firehose_sdx24.mbn",
260265
.config = &modem_qcom_v1_mhiv_config,
261266
.bar_num = MHI_PCI_DEFAULT_BAR_NUM,
262-
.dma_data_width = 32
267+
.dma_data_width = 32,
268+
.sideband_wake = true,
263269
};
264270

265271
static const struct mhi_channel_config mhi_quectel_em1xx_channels[] = {
@@ -301,7 +307,8 @@ static const struct mhi_pci_dev_info mhi_quectel_em1xx_info = {
301307
.edl = "qcom/prog_firehose_sdx24.mbn",
302308
.config = &modem_quectel_em1xx_config,
303309
.bar_num = MHI_PCI_DEFAULT_BAR_NUM,
304-
.dma_data_width = 32
310+
.dma_data_width = 32,
311+
.sideband_wake = true,
305312
};
306313

307314
static const struct mhi_channel_config mhi_foxconn_sdx55_channels[] = {
@@ -339,7 +346,8 @@ static const struct mhi_pci_dev_info mhi_foxconn_sdx55_info = {
339346
.edl = "qcom/sdx55m/edl.mbn",
340347
.config = &modem_foxconn_sdx55_config,
341348
.bar_num = MHI_PCI_DEFAULT_BAR_NUM,
342-
.dma_data_width = 32
349+
.dma_data_width = 32,
350+
.sideband_wake = false,
343351
};
344352

345353
static const struct pci_device_id mhi_pci_id_table[] = {
@@ -640,9 +648,12 @@ static int mhi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
640648
mhi_cntrl->status_cb = mhi_pci_status_cb;
641649
mhi_cntrl->runtime_get = mhi_pci_runtime_get;
642650
mhi_cntrl->runtime_put = mhi_pci_runtime_put;
643-
mhi_cntrl->wake_get = mhi_pci_wake_get_nop;
644-
mhi_cntrl->wake_put = mhi_pci_wake_put_nop;
645-
mhi_cntrl->wake_toggle = mhi_pci_wake_toggle_nop;
651+
652+
if (info->sideband_wake) {
653+
mhi_cntrl->wake_get = mhi_pci_wake_get_nop;
654+
mhi_cntrl->wake_put = mhi_pci_wake_put_nop;
655+
mhi_cntrl->wake_toggle = mhi_pci_wake_toggle_nop;
656+
}
646657

647658
err = mhi_pci_claim(mhi_cntrl, info->bar_num, DMA_BIT_MASK(info->dma_data_width));
648659
if (err)

0 commit comments

Comments
 (0)