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

Commit 246e51b5 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: mdm: Use channel ready gpio to indicate link status"

parents 60c0f235 91df0bf5
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -36,6 +36,8 @@ Optional named gpio properties:
		booted into the PBL bootloader.
- qcom,ap2mdm-wakeup-gpio: gpio used by the apps processor to wake the external modem
		out of a low power state.
- qcom,ap2mdm-chnl-rdy-gpio: gpio used by the apps processor to inform the external modem
		that data link is ready.
- qcom,mdm2ap-wakeup-gpio: gpio from the external modem to the apps processor to wake it
		out of a low power state.
- qcom,ap2mdm-vddmin-gpio: gpio to indicate to the external modem when the apps processor
+4 −4
Original line number Diff line number Diff line
@@ -225,8 +225,8 @@ static void mdm_power_on_common(struct mdm_modem_drv *mdm_drv)
	 * de-assert it now so that it can be asserted later.
	 * May not be used.
	 */
	if (GPIO_IS_VALID(MDM_GPIO(AP2MDM_WAKEUP)))
		gpio_direction_output(MDM_GPIO(AP2MDM_WAKEUP), 0);
	if (GPIO_IS_VALID(MDM_GPIO(AP2MDM_CHNLRDY)))
		gpio_direction_output(MDM_GPIO(AP2MDM_CHNLRDY), 0);

	/*
	 * If we did an "early power on" then ignore the very next
@@ -260,8 +260,8 @@ static void mdm_status_changed(struct mdm_modem_drv *mdm_drv, int value)
		mdm_peripheral_disconnect(mdm_drv);
		msleep(100);
		mdm_peripheral_connect(mdm_drv);
		if (GPIO_IS_VALID(MDM_GPIO(AP2MDM_WAKEUP)))
			gpio_direction_output(MDM_GPIO(AP2MDM_WAKEUP), 1);
		if (GPIO_IS_VALID(MDM_GPIO(AP2MDM_CHNLRDY)))
			gpio_direction_output(MDM_GPIO(AP2MDM_CHNLRDY), 1);
	}
}

+12 −4
Original line number Diff line number Diff line
@@ -140,6 +140,7 @@ static struct gpio_map {
	{"qcom,ap2mdm-status-gpio",     AP2MDM_STATUS},
	{"qcom,mdm2ap-pblrdy-gpio",     MDM2AP_PBLRDY},
	{"qcom,ap2mdm-wakeup-gpio",     AP2MDM_WAKEUP},
	{"qcom,ap2mdm-chnlrdy-gpio",     AP2MDM_CHNLRDY},
	{"qcom,mdm2ap-wakeup-gpio",     MDM2AP_WAKEUP},
	{"qcom,ap2mdm-vddmin-gpio",     AP2MDM_VDDMIN},
	{"qcom,mdm2ap-vddmin-gpio",     MDM2AP_VDDMIN},
@@ -476,9 +477,9 @@ static long mdm_modem_ioctl(struct file *filp, unsigned int cmd,
		/* If userspace has reset the peripheral device then
		 * inform the modem here.
		 */
		if (GPIO_IS_VALID(MDM_GPIO(AP2MDM_WAKEUP)))
		if (GPIO_IS_VALID(MDM_GPIO(AP2MDM_CHNLRDY)))
				gpio_direction_output(
				   MDM_GPIO(AP2MDM_WAKEUP), 1);
				   MDM_GPIO(AP2MDM_CHNLRDY), 1);

		/* If successful, start a timer to check that the mdm2ap_status
		 * gpio goes high.
@@ -1176,6 +1177,13 @@ static int mdm_configure_ipc(struct mdm_device *mdev)
			goto fatal_err;
		}
	}
	if (GPIO_IS_VALID(MDM_GPIO(AP2MDM_CHNLRDY))) {
		if (gpio_request(MDM_GPIO(AP2MDM_CHNLRDY), "AP2MDM_CHNLRDY")) {
			pr_err("%s Failed to configure AP2MDM_CHNLRDY gpio\n",
				   __func__);
			goto fatal_err;
		}
	}
	if (GPIO_IS_VALID(MDM_GPIO(USB_SW))) {
		if (gpio_request(MDM_GPIO(USB_SW), "USB_SW"))
			pr_err("%s Failed to configure usb switch gpio\n",
@@ -1185,8 +1193,8 @@ static int mdm_configure_ipc(struct mdm_device *mdev)
	gpio_direction_output(MDM_GPIO(AP2MDM_STATUS), 0);
	gpio_direction_output(MDM_GPIO(AP2MDM_ERRFATAL), 0);

	if (GPIO_IS_VALID(MDM_GPIO(AP2MDM_WAKEUP)))
		gpio_direction_output(MDM_GPIO(AP2MDM_WAKEUP), 0);
	if (GPIO_IS_VALID(MDM_GPIO(AP2MDM_CHNLRDY)))
		gpio_direction_output(MDM_GPIO(AP2MDM_CHNLRDY), 0);

	gpio_direction_input(MDM_GPIO(MDM2AP_STATUS));
	gpio_direction_input(MDM_GPIO(MDM2AP_ERRFATAL));
+1 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ enum {
	AP2MDM_SOFT_RESET,
	MDM2AP_WAKEUP,
	AP2MDM_WAKEUP,
	AP2MDM_CHNLRDY,
	AP2MDM_KPDPWR,
	AP2MDM_PMIC_PWR_EN,
	MDM2AP_PBLRDY,