Loading Documentation/devicetree/bindings/arm/msm/mdm-modem.txt +4 −0 Original line number Diff line number Diff line Loading @@ -108,6 +108,10 @@ Optional driver parameters: - qcom,sysmon-id: platform device id that sysmon is probed with for the subsystem. - qcom,pil-force-shutdown: Boolean. If set, the SSR framework will not trigger graceful shutdown on behalf of the subsystem driver. - qcom,mdm-auto-boot: Boolean. To indicate this instance of esoc boots independently. - qcom,mdm-statusline-not-a-powersource: Boolean. If set, status line to esoc device is not a power source. - qcom,mdm-userspace-handle-shutdown: Boolean. If set, userspace handles shutdown requests. Example: mdm0: qcom,mdm0 { Loading drivers/esoc/esoc-mdm-4x.c +19 −8 Original line number Diff line number Diff line Loading @@ -211,13 +211,17 @@ static int mdm_cmd_exe(enum esoc_cmd cmd, struct esoc_clink *esoc) if (esoc->primary) break; graceful_shutdown = true; if (!esoc->userspace_handle_shutdown) { ret = sysmon_send_shutdown(&esoc->subsys); if (ret) { dev_err(mdm->dev, "sysmon shutdown fail, ret = %d\n", ret); dev_err(mdm->dev, "sysmon shutdown fail, ret = %d\n", ret); graceful_shutdown = false; goto force_poff; } } else { esoc_clink_queue_request(ESOC_REQ_SEND_SHUTDOWN, esoc); } dev_dbg(mdm->dev, "Waiting for status gpio go low\n"); status_down = false; end_time = jiffies + msecs_to_jiffies(10000); Loading Loading @@ -251,8 +255,11 @@ force_poff: /* * Force a shutdown of the mdm. This is required in order * to prevent the mdm from immediately powering back on * after the shutdown * after the shutdown. Avoid setting status to 0, if line is * monitored by multiple mdms(might be wrongly interpreted as * a primary crash). */ if (esoc->statusline_not_a_powersource == false) gpio_set_value(MDM_GPIO(mdm, AP2MDM_STATUS), 0); esoc_clink_queue_request(ESOC_REQ_SHUTDOWN, esoc); mdm_power_down(mdm); Loading Loading @@ -1000,6 +1007,10 @@ static int mdm9x45_setup_hw(struct mdm_ctrl *mdm, esoc->auto_boot = of_property_read_bool(esoc->np, "qcom,mdm-auto-boot"); esoc->statusline_not_a_powersource = of_property_read_bool(esoc->np, "qcom,mdm-statusline-not-a-powersource"); esoc->userspace_handle_shutdown = of_property_read_bool(esoc->np, "qcom,mdm-userspace-handle-shutdown"); set_esoc_clink_data(esoc, mdm); ret = esoc_clink_register(esoc); if (ret) { Loading drivers/esoc/esoc.h +5 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,9 @@ struct esoc_eng { * @auto_boot: boots independently. * @primary: primary esoc controls(reset/poweroff) all secondary * esocs, but not otherway around. * @statusline_not_a_powersource: True if status line to esoc is not a * power source. * @userspace_handle_shutdown: True if user space handles shutdown requests. */ struct esoc_clink { const char *name; Loading @@ -82,6 +85,8 @@ struct esoc_clink { struct device_node *np; bool auto_boot; bool primary; bool statusline_not_a_powersource; bool userspace_handle_shutdown; }; /** Loading include/uapi/linux/esoc_ctrl.h +2 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ #define HSIC "HSIC" #define HSICPCIe "HSIC+PCIe" #define PCIe "PCIe" #define ESOC_REQ_SEND_SHUTDOWN ESOC_REQ_SEND_SHUTDOWN enum esoc_evt { ESOC_RUN_STATE = 0x1, Loading Loading @@ -56,6 +57,7 @@ enum esoc_req { ESOC_REQ_IMG = 1, ESOC_REQ_DEBUG, ESOC_REQ_SHUTDOWN, ESOC_REQ_SEND_SHUTDOWN, }; #ifdef __KERNEL__ Loading Loading
Documentation/devicetree/bindings/arm/msm/mdm-modem.txt +4 −0 Original line number Diff line number Diff line Loading @@ -108,6 +108,10 @@ Optional driver parameters: - qcom,sysmon-id: platform device id that sysmon is probed with for the subsystem. - qcom,pil-force-shutdown: Boolean. If set, the SSR framework will not trigger graceful shutdown on behalf of the subsystem driver. - qcom,mdm-auto-boot: Boolean. To indicate this instance of esoc boots independently. - qcom,mdm-statusline-not-a-powersource: Boolean. If set, status line to esoc device is not a power source. - qcom,mdm-userspace-handle-shutdown: Boolean. If set, userspace handles shutdown requests. Example: mdm0: qcom,mdm0 { Loading
drivers/esoc/esoc-mdm-4x.c +19 −8 Original line number Diff line number Diff line Loading @@ -211,13 +211,17 @@ static int mdm_cmd_exe(enum esoc_cmd cmd, struct esoc_clink *esoc) if (esoc->primary) break; graceful_shutdown = true; if (!esoc->userspace_handle_shutdown) { ret = sysmon_send_shutdown(&esoc->subsys); if (ret) { dev_err(mdm->dev, "sysmon shutdown fail, ret = %d\n", ret); dev_err(mdm->dev, "sysmon shutdown fail, ret = %d\n", ret); graceful_shutdown = false; goto force_poff; } } else { esoc_clink_queue_request(ESOC_REQ_SEND_SHUTDOWN, esoc); } dev_dbg(mdm->dev, "Waiting for status gpio go low\n"); status_down = false; end_time = jiffies + msecs_to_jiffies(10000); Loading Loading @@ -251,8 +255,11 @@ force_poff: /* * Force a shutdown of the mdm. This is required in order * to prevent the mdm from immediately powering back on * after the shutdown * after the shutdown. Avoid setting status to 0, if line is * monitored by multiple mdms(might be wrongly interpreted as * a primary crash). */ if (esoc->statusline_not_a_powersource == false) gpio_set_value(MDM_GPIO(mdm, AP2MDM_STATUS), 0); esoc_clink_queue_request(ESOC_REQ_SHUTDOWN, esoc); mdm_power_down(mdm); Loading Loading @@ -1000,6 +1007,10 @@ static int mdm9x45_setup_hw(struct mdm_ctrl *mdm, esoc->auto_boot = of_property_read_bool(esoc->np, "qcom,mdm-auto-boot"); esoc->statusline_not_a_powersource = of_property_read_bool(esoc->np, "qcom,mdm-statusline-not-a-powersource"); esoc->userspace_handle_shutdown = of_property_read_bool(esoc->np, "qcom,mdm-userspace-handle-shutdown"); set_esoc_clink_data(esoc, mdm); ret = esoc_clink_register(esoc); if (ret) { Loading
drivers/esoc/esoc.h +5 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,9 @@ struct esoc_eng { * @auto_boot: boots independently. * @primary: primary esoc controls(reset/poweroff) all secondary * esocs, but not otherway around. * @statusline_not_a_powersource: True if status line to esoc is not a * power source. * @userspace_handle_shutdown: True if user space handles shutdown requests. */ struct esoc_clink { const char *name; Loading @@ -82,6 +85,8 @@ struct esoc_clink { struct device_node *np; bool auto_boot; bool primary; bool statusline_not_a_powersource; bool userspace_handle_shutdown; }; /** Loading
include/uapi/linux/esoc_ctrl.h +2 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ #define HSIC "HSIC" #define HSICPCIe "HSIC+PCIe" #define PCIe "PCIe" #define ESOC_REQ_SEND_SHUTDOWN ESOC_REQ_SEND_SHUTDOWN enum esoc_evt { ESOC_RUN_STATE = 0x1, Loading Loading @@ -56,6 +57,7 @@ enum esoc_req { ESOC_REQ_IMG = 1, ESOC_REQ_DEBUG, ESOC_REQ_SHUTDOWN, ESOC_REQ_SEND_SHUTDOWN, }; #ifdef __KERNEL__ Loading