bus: mhi: host: Add UL and DL event ring IDs to MHI device

Offload channels where the client drivers manage their own
context information need event ring information in the MHI
device structure that is currently not exposed to them. Add
those to enable these drivers to function properly.

Change-Id: Icc80344518591ca74c75ab932ac15eca9a77d0ad
Signed-off-by: Bhaumik Bhatt <bbhatt@codeaurora.org>
Signed-off-by: Lazarus Motha <quic_lmotha@quicinc.com>
This commit is contained in:
Bhaumik Bhatt 2021-01-19 15:58:09 -08:00 committed by Gerrit - the friendly Code Review server
parent d11c150a81
commit bd9e89fec7
2 changed files with 9 additions and 1 deletions

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
*
*/
@ -378,11 +378,13 @@ void mhi_create_devices(struct mhi_controller *mhi_cntrl)
case DMA_TO_DEVICE:
mhi_dev->ul_chan = mhi_chan;
mhi_dev->ul_chan_id = mhi_chan->chan;
mhi_dev->ul_event_id = mhi_chan->er_index;
break;
case DMA_FROM_DEVICE:
/* We use dl_chan as offload channels */
mhi_dev->dl_chan = mhi_chan;
mhi_dev->dl_chan_id = mhi_chan->chan;
mhi_dev->dl_event_id = mhi_chan->er_index;
break;
default:
dev_err(dev, "Direction not supported\n");
@ -401,9 +403,11 @@ void mhi_create_devices(struct mhi_controller *mhi_cntrl)
if (mhi_chan->dir == DMA_TO_DEVICE) {
mhi_dev->ul_chan = mhi_chan;
mhi_dev->ul_chan_id = mhi_chan->chan;
mhi_dev->ul_event_id = mhi_chan->er_index;
} else {
mhi_dev->dl_chan = mhi_chan;
mhi_dev->dl_chan_id = mhi_chan->chan;
mhi_dev->dl_event_id = mhi_chan->er_index;
}
get_device(&mhi_dev->dev);
mhi_chan->mhi_dev = mhi_dev;

View File

@ -491,7 +491,9 @@ struct mhi_controller {
* @dev: Driver model device node for the MHI device
* @dev_type: MHI device type
* @ul_chan_id: MHI channel id for UL transfer
* @ul_event_id: MHI event ring id for UL transfer
* @dl_chan_id: MHI channel id for DL transfer
* @ul_event_id: MHI event ring id for DL transfer
* @dev_wake: Device wakeup counter
*/
struct mhi_device {
@ -503,7 +505,9 @@ struct mhi_device {
struct device dev;
enum mhi_device_type dev_type;
int ul_chan_id;
int ul_event_id;
int dl_chan_id;
int dl_event_id;
u32 dev_wake;
};