diff --git a/drivers/bus/mhi/host/main.c b/drivers/bus/mhi/host/main.c index ec9c7e12f9ba..0dc847c18191 100644 --- a/drivers/bus/mhi/host/main.c +++ b/drivers/bus/mhi/host/main.c @@ -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; diff --git a/include/linux/mhi.h b/include/linux/mhi.h index 3ba339d087b8..a2b2bc7b59c5 100644 --- a/include/linux/mhi.h +++ b/include/linux/mhi.h @@ -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; };