Loading drivers/esoc/esoc-mdm-4x.c +15 −2 Original line number Diff line number Diff line Loading @@ -482,7 +482,7 @@ static irqreturn_t mdm_pblrdy_change(int irq, void *dev_id) return IRQ_HANDLED; } static int mdm_get_status(u32 *status, struct esoc_clink *esoc) static void mdm_get_status(u32 *status, struct esoc_clink *esoc) { struct mdm_ctrl *mdm = get_esoc_clink_data(esoc); Loading @@ -490,7 +490,16 @@ static int mdm_get_status(u32 *status, struct esoc_clink *esoc) *status = 0; else *status = 1; return 0; } static void mdm_get_err_fatal(u32 *status, struct esoc_clink *esoc) { struct mdm_ctrl *mdm = get_esoc_clink_data(esoc); if (gpio_get_value(MDM_GPIO(mdm, MDM2AP_ERRFATAL)) == 0) *status = 0; else *status = 1; } static void mdm_configure_debug(struct mdm_ctrl *mdm) Loading Loading @@ -748,6 +757,7 @@ static int mdm9x25_setup_hw(struct mdm_ctrl *mdm, dev_err(mdm->dev, "cannot allocate esoc device\n"); return PTR_ERR(esoc); } esoc->pdev = pdev; mdm->mdm_queue = alloc_workqueue("mdm_queue", 0, 0); if (!mdm->mdm_queue) { dev_err(mdm->dev, "could not create mdm_queue\n"); Loading Loading @@ -818,6 +828,7 @@ static int mdm9x35_setup_hw(struct mdm_ctrl *mdm, dev_err(mdm->dev, "cannot allocate esoc device\n"); return PTR_ERR(esoc); } esoc->pdev = pdev; mdm->mdm_queue = alloc_workqueue("mdm_queue", 0, 0); if (!mdm->mdm_queue) { dev_err(mdm->dev, "could not create mdm_queue\n"); Loading Loading @@ -906,6 +917,7 @@ static int mdm9x55_setup_hw(struct mdm_ctrl *mdm, dev_err(mdm->dev, "cannot allocate esoc device\n"); return PTR_ERR(esoc); } esoc->pdev = pdev; mdm->mdm_queue = alloc_workqueue("mdm_queue", 0, 0); if (!mdm->mdm_queue) { dev_err(mdm->dev, "could not create mdm_queue\n"); Loading Loading @@ -966,6 +978,7 @@ static int mdm9x55_setup_hw(struct mdm_ctrl *mdm, static struct esoc_clink_ops mdm_cops = { .cmd_exe = mdm_cmd_exe, .get_status = mdm_get_status, .get_err_fatal = mdm_get_err_fatal, .notify = mdm_notify, }; Loading drivers/esoc/esoc.h +5 −1 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ struct esoc_eng { * @link_info: additional info about the physical link. * @parent: parent device. * @dev: device for userspace interface. * @pdev: platform device to interface with SSR driver. * @id: id of the external device. * @owner: owner of the device. * @clink_ops: control operations for the control link Loading @@ -66,6 +67,7 @@ struct esoc_clink { const char *link_info; struct device *parent; struct device dev; struct platform_device *pdev; unsigned int id; struct module *owner; const struct esoc_clink_ops *clink_ops; Loading @@ -83,11 +85,13 @@ struct esoc_clink { * struct esoc_clink_ops: Operations to control external soc * @cmd_exe: Execute control command * @get_status: Get current status, or response to previous command * @get_err_fatal: Get status of err fatal signal * @notify_esoc: notify external soc of events */ struct esoc_clink_ops { int (*cmd_exe)(enum esoc_cmd cmd, struct esoc_clink *dev); int (*get_status)(u32 *status, struct esoc_clink *dev); void (*get_status)(u32 *status, struct esoc_clink *dev); void (*get_err_fatal)(u32 *status, struct esoc_clink *dev); void (*notify)(enum esoc_notify notify, struct esoc_clink *dev); }; Loading drivers/esoc/esoc_bus.c +1 −1 Original line number Diff line number Diff line Loading @@ -189,7 +189,7 @@ int esoc_clink_register_ssr(struct esoc_clink *esoc_clink) snprintf(subsys_name, len, "esoc%d", esoc_clink->id); esoc_clink->subsys.name = subsys_name; esoc_clink->dev.of_node = esoc_clink->np; esoc_clink->subsys.dev = &esoc_clink->dev; esoc_clink->subsys.dev = &esoc_clink->pdev->dev; esoc_clink->subsys_dev = subsys_register(&esoc_clink->subsys); if (IS_ERR_OR_NULL(esoc_clink->subsys_dev)) { dev_err(&esoc_clink->dev, "failed to register ssr node\n"); Loading drivers/esoc/esoc_dev.c +5 −4 Original line number Diff line number Diff line Loading @@ -224,9 +224,11 @@ static long esoc_dev_ioctl(struct file *file, unsigned int cmd, clink_ops->notify(esoc_cmd, esoc_clink); break; case ESOC_GET_STATUS: err = clink_ops->get_status(&status, esoc_clink); if (err) return err; clink_ops->get_status(&status, esoc_clink); put_user(status, (unsigned int __user *)uarg); break; case ESOC_GET_ERR_FATAL: clink_ops->get_err_fatal(&status, esoc_clink); put_user(status, (unsigned int __user *)uarg); break; case ESOC_WAIT_FOR_CRASH: Loading Loading @@ -336,7 +338,6 @@ int esoc_clink_del_device(struct device *dev, void *dummy) esoc_udev = esoc_udev_get_by_minor(esoc_clink->id); if (!esoc_udev) return 0; return_esoc_udev(esoc_udev); device_destroy(esoc_class, MKDEV(esoc_major, esoc_clink->id)); return_esoc_udev(esoc_udev); return 0; Loading include/uapi/linux/esoc_ctrl.h +1 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ #define ESOC_WAIT_FOR_REQ _IOR(ESOC_CODE, 2, unsigned int) #define ESOC_NOTIFY _IOW(ESOC_CODE, 3, unsigned int) #define ESOC_GET_STATUS _IOR(ESOC_CODE, 4, unsigned int) #define ESOC_GET_ERR_FATAL _IOR(ESOC_CODE, 5, unsigned int) #define ESOC_WAIT_FOR_CRASH _IOR(ESOC_CODE, 6, unsigned int) #define ESOC_REG_REQ_ENG _IO(ESOC_CODE, 7) #define ESOC_REG_CMD_ENG _IO(ESOC_CODE, 8) Loading Loading
drivers/esoc/esoc-mdm-4x.c +15 −2 Original line number Diff line number Diff line Loading @@ -482,7 +482,7 @@ static irqreturn_t mdm_pblrdy_change(int irq, void *dev_id) return IRQ_HANDLED; } static int mdm_get_status(u32 *status, struct esoc_clink *esoc) static void mdm_get_status(u32 *status, struct esoc_clink *esoc) { struct mdm_ctrl *mdm = get_esoc_clink_data(esoc); Loading @@ -490,7 +490,16 @@ static int mdm_get_status(u32 *status, struct esoc_clink *esoc) *status = 0; else *status = 1; return 0; } static void mdm_get_err_fatal(u32 *status, struct esoc_clink *esoc) { struct mdm_ctrl *mdm = get_esoc_clink_data(esoc); if (gpio_get_value(MDM_GPIO(mdm, MDM2AP_ERRFATAL)) == 0) *status = 0; else *status = 1; } static void mdm_configure_debug(struct mdm_ctrl *mdm) Loading Loading @@ -748,6 +757,7 @@ static int mdm9x25_setup_hw(struct mdm_ctrl *mdm, dev_err(mdm->dev, "cannot allocate esoc device\n"); return PTR_ERR(esoc); } esoc->pdev = pdev; mdm->mdm_queue = alloc_workqueue("mdm_queue", 0, 0); if (!mdm->mdm_queue) { dev_err(mdm->dev, "could not create mdm_queue\n"); Loading Loading @@ -818,6 +828,7 @@ static int mdm9x35_setup_hw(struct mdm_ctrl *mdm, dev_err(mdm->dev, "cannot allocate esoc device\n"); return PTR_ERR(esoc); } esoc->pdev = pdev; mdm->mdm_queue = alloc_workqueue("mdm_queue", 0, 0); if (!mdm->mdm_queue) { dev_err(mdm->dev, "could not create mdm_queue\n"); Loading Loading @@ -906,6 +917,7 @@ static int mdm9x55_setup_hw(struct mdm_ctrl *mdm, dev_err(mdm->dev, "cannot allocate esoc device\n"); return PTR_ERR(esoc); } esoc->pdev = pdev; mdm->mdm_queue = alloc_workqueue("mdm_queue", 0, 0); if (!mdm->mdm_queue) { dev_err(mdm->dev, "could not create mdm_queue\n"); Loading Loading @@ -966,6 +978,7 @@ static int mdm9x55_setup_hw(struct mdm_ctrl *mdm, static struct esoc_clink_ops mdm_cops = { .cmd_exe = mdm_cmd_exe, .get_status = mdm_get_status, .get_err_fatal = mdm_get_err_fatal, .notify = mdm_notify, }; Loading
drivers/esoc/esoc.h +5 −1 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ struct esoc_eng { * @link_info: additional info about the physical link. * @parent: parent device. * @dev: device for userspace interface. * @pdev: platform device to interface with SSR driver. * @id: id of the external device. * @owner: owner of the device. * @clink_ops: control operations for the control link Loading @@ -66,6 +67,7 @@ struct esoc_clink { const char *link_info; struct device *parent; struct device dev; struct platform_device *pdev; unsigned int id; struct module *owner; const struct esoc_clink_ops *clink_ops; Loading @@ -83,11 +85,13 @@ struct esoc_clink { * struct esoc_clink_ops: Operations to control external soc * @cmd_exe: Execute control command * @get_status: Get current status, or response to previous command * @get_err_fatal: Get status of err fatal signal * @notify_esoc: notify external soc of events */ struct esoc_clink_ops { int (*cmd_exe)(enum esoc_cmd cmd, struct esoc_clink *dev); int (*get_status)(u32 *status, struct esoc_clink *dev); void (*get_status)(u32 *status, struct esoc_clink *dev); void (*get_err_fatal)(u32 *status, struct esoc_clink *dev); void (*notify)(enum esoc_notify notify, struct esoc_clink *dev); }; Loading
drivers/esoc/esoc_bus.c +1 −1 Original line number Diff line number Diff line Loading @@ -189,7 +189,7 @@ int esoc_clink_register_ssr(struct esoc_clink *esoc_clink) snprintf(subsys_name, len, "esoc%d", esoc_clink->id); esoc_clink->subsys.name = subsys_name; esoc_clink->dev.of_node = esoc_clink->np; esoc_clink->subsys.dev = &esoc_clink->dev; esoc_clink->subsys.dev = &esoc_clink->pdev->dev; esoc_clink->subsys_dev = subsys_register(&esoc_clink->subsys); if (IS_ERR_OR_NULL(esoc_clink->subsys_dev)) { dev_err(&esoc_clink->dev, "failed to register ssr node\n"); Loading
drivers/esoc/esoc_dev.c +5 −4 Original line number Diff line number Diff line Loading @@ -224,9 +224,11 @@ static long esoc_dev_ioctl(struct file *file, unsigned int cmd, clink_ops->notify(esoc_cmd, esoc_clink); break; case ESOC_GET_STATUS: err = clink_ops->get_status(&status, esoc_clink); if (err) return err; clink_ops->get_status(&status, esoc_clink); put_user(status, (unsigned int __user *)uarg); break; case ESOC_GET_ERR_FATAL: clink_ops->get_err_fatal(&status, esoc_clink); put_user(status, (unsigned int __user *)uarg); break; case ESOC_WAIT_FOR_CRASH: Loading Loading @@ -336,7 +338,6 @@ int esoc_clink_del_device(struct device *dev, void *dummy) esoc_udev = esoc_udev_get_by_minor(esoc_clink->id); if (!esoc_udev) return 0; return_esoc_udev(esoc_udev); device_destroy(esoc_class, MKDEV(esoc_major, esoc_clink->id)); return_esoc_udev(esoc_udev); return 0; Loading
include/uapi/linux/esoc_ctrl.h +1 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ #define ESOC_WAIT_FOR_REQ _IOR(ESOC_CODE, 2, unsigned int) #define ESOC_NOTIFY _IOW(ESOC_CODE, 3, unsigned int) #define ESOC_GET_STATUS _IOR(ESOC_CODE, 4, unsigned int) #define ESOC_GET_ERR_FATAL _IOR(ESOC_CODE, 5, unsigned int) #define ESOC_WAIT_FOR_CRASH _IOR(ESOC_CODE, 6, unsigned int) #define ESOC_REG_REQ_ENG _IO(ESOC_CODE, 7) #define ESOC_REG_CMD_ENG _IO(ESOC_CODE, 8) Loading