Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4c11c601 authored by Vamsi krishna Gattupalli's avatar Vamsi krishna Gattupalli
Browse files

msm: ADSPRPC: Enable Sensors PDR support



Register for ADSP Sensors PDR notifications and handle Sensors PDR
By notifying all the Sensor static PD clients.

Change-Id: I0bd8d46bb01041f08e65bba616c406f88d46c0ed
Acked-by: default avatarNishant Chaubey <chaubey@qti.qualcomm.com>
Signed-off-by: default avatarVamsi krishna Gattupalli <vgattupa@codeaurora.org>
parent 1593b765
Loading
Loading
Loading
Loading
+30 −22
Original line number Diff line number Diff line
@@ -4012,31 +4012,39 @@ static int fastrpc_get_service_location_notify(struct notifier_block *nb,
		pr_err("ADSPRPC: Audio PD restart notifier locator down\n");
		return NOTIFY_DONE;
	}

	for (i = 0; i < pdr->total_domains; i++) {
		if ((!strcmp(pdr->domain_list[i].name,
					"msm/adsp/audio_pd")) ||
					(!strcmp(pdr->domain_list[i].name,
		if ((!strcmp(spd->spdname, "audio_pdr_adsprpc"))
					&& (!strcmp(pdr->domain_list[i].name,
						"msm/adsp/audio_pd"))) {
			goto pdr_register;
		} else if ((!strcmp(spd->spdname, "sensors_pdr_adsprpc"))
					&& (!strcmp(pdr->domain_list[i].name,
						"msm/adsp/sensor_pd"))) {
			goto pdr_register;
		}
	}
	return NOTIFY_DONE;

pdr_register:
	if (!spd->pdrhandle) {
		spd->pdrhandle =
			service_notif_register_notifier(
			pdr->domain_list[i].name,
			pdr->domain_list[i].instance_id,
			&spd->pdrnb, &curr_state);
			if (IS_ERR(spd->pdrhandle)) {
	} else {
		pr_err("ADSPRPC: %s is already registered\n", spd->spdname);
	}

	if (IS_ERR(spd->pdrhandle))
		pr_err("ADSPRPC: Unable to register notifier\n");
			} else if (curr_state ==
				SERVREG_NOTIF_SERVICE_STATE_UP_V01) {
				pr_info("ADSPRPC: STATE_UP_V01 received\n");

	if (curr_state == SERVREG_NOTIF_SERVICE_STATE_UP_V01) {
		pr_info("ADSPRPC: %s is up\n", spd->spdname);
		spd->ispdup = 1;
			} else if (curr_state ==
				SERVREG_NOTIF_SERVICE_STATE_UNINIT_V01) {
				pr_info("ADSPRPC: STATE_UNINIT_V01 received\n");
			}
			break;
		}
	} else if (curr_state == SERVREG_NOTIF_SERVICE_STATE_UNINIT_V01) {
		pr_info("ADSPRPC: %s is uninitialzed\n", spd->spdname);
	}

	return NOTIFY_DONE;
}