msm: mhi_dev: Update notification on channel state

Update channel state notification broadcast to software channels
only as there are no clients listening to the broadcast for the
HW channel state updates. State updates include channel start,
stop and reset commands.

Change-Id: Ic378acf4a7afc80b7c9e7acdfbf822608983a427
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
tirimbino
Siddartha Mohanadoss 5 years ago
parent de364d8476
commit 88837c0492
  1. 14
      drivers/platform/msm/mhi_dev/mhi.c

@ -1538,6 +1538,10 @@ static void mhi_dev_trigger_cb(enum mhi_client_channel ch_id)
struct mhi_dev_ready_cb_info *info;
enum mhi_ctrl_info state_data;
/* Currently no clients register for HW channel notification */
if (ch_id >= MHI_MAX_SOFTWARE_CHANNELS)
return;
list_for_each_entry(info, &mhi_ctx->client_cb_list, list)
if (info->cb && info->cb_data.channel == ch_id) {
mhi_ctrl_state_info(info->cb_data.channel, &state_data);
@ -2036,7 +2040,7 @@ static void mhi_update_state_info_all(enum mhi_ctrl_info info)
struct mhi_dev_client_cb_reason reason;
mhi_ctx->ctrl_info = info;
for (i = 0; i < MHI_MAX_CHANNELS; ++i) {
for (i = 0; i < MHI_MAX_SOFTWARE_CHANNELS; ++i) {
channel_state_info[i].ctrl_info = info;
/* Notify kernel clients */
mhi_dev_trigger_cb(i);
@ -3333,7 +3337,7 @@ int mhi_register_state_cb(void (*mhi_state_cb)
if (WARN_ON(!mhi_ctx))
return -ENXIO;
if (channel > MHI_MAX_CHANNELS) {
if (channel >= MHI_MAX_SOFTWARE_CHANNELS) {
pr_err("Invalid channel :%d\n", channel);
return -EINVAL;
}
@ -3373,6 +3377,10 @@ static void mhi_update_state_info_ch(uint32_t ch_id, enum mhi_ctrl_info info)
{
struct mhi_dev_client_cb_reason reason;
/* Currently no clients register for HW channel notification */
if (ch_id >= MHI_MAX_SOFTWARE_CHANNELS)
return;
channel_state_info[ch_id].ctrl_info = info;
if (ch_id == MHI_CLIENT_QMI_OUT || ch_id == MHI_CLIENT_QMI_IN) {
/* For legacy reasons for QTI client */
@ -3392,7 +3400,7 @@ int mhi_ctrl_state_info(uint32_t idx, uint32_t *info)
if (idx == MHI_DEV_UEVENT_CTRL)
*info = mhi_ctx->ctrl_info;
else
if (idx < MHI_MAX_CHANNELS)
if (idx < MHI_MAX_SOFTWARE_CHANNELS)
*info = channel_state_info[idx].ctrl_info;
else
return -EINVAL;

Loading…
Cancel
Save