summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/arm64/boot/dts/freescale/imx8dxl-evk.dts5
-rw-r--r--drivers/clk/imx/clk-imx8qxp.c2
-rw-r--r--drivers/crypto/caam/ctrl.c11
-rw-r--r--drivers/firmware/imx/imx-scu-irq.c60
-rw-r--r--drivers/firmware/imx/seco_mu.c6
-rw-r--r--drivers/gpio/gpio-mxc.c1
-rw-r--r--drivers/gpu/drm/imx/mhdp/cdns-mhdp-imx8qm.c65
-rw-r--r--drivers/gpu/drm/imx/mhdp/cdns-mhdp-imxdrv.c1
-rw-r--r--drivers/gpu/drm/mxsfb/mxsfb_out.c2
-rw-r--r--drivers/mailbox/imx-mailbox.c11
-rw-r--r--drivers/remoteproc/imx_rproc.c4
-rw-r--r--drivers/rpmsg/imx_rpmsg.c8
-rw-r--r--drivers/rtc/rtc-imx-sc.c7
-rw-r--r--drivers/staging/media/imx/imx8-isi-cap.c9
-rw-r--r--drivers/staging/media/imx/imx8-isi-core.h1
-rw-r--r--drivers/watchdog/imx_sc_wdt.c21
-rw-r--r--include/linux/firmware/imx/sci.h24
17 files changed, 144 insertions, 94 deletions
diff --git a/arch/arm64/boot/dts/freescale/imx8dxl-evk.dts b/arch/arm64/boot/dts/freescale/imx8dxl-evk.dts
index 2df401327313..9d06d25a2d8f 100644
--- a/arch/arm64/boot/dts/freescale/imx8dxl-evk.dts
+++ b/arch/arm64/boot/dts/freescale/imx8dxl-evk.dts
@@ -343,7 +343,6 @@
reg = <0x20>;
gpio-controller;
#gpio-cells = <2>;
- power-domains = <&pd IMX_SC_R_BOARD_R1>;
};
pca6416_2: gpio@21 {
@@ -351,7 +350,6 @@
reg = <0x21>;
gpio-controller;
#gpio-cells = <2>;
- power-domains = <&pd IMX_SC_R_BOARD_R2>;
};
pca9548_1: pca9548@70 {
@@ -359,7 +357,6 @@
#address-cells = <1>;
#size-cells = <0>;
reg = <0x70>;
- power-domains = <&pd IMX_SC_R_BOARD_R0>;
i2c@0 {
#address-cells = <1>;
@@ -470,7 +467,6 @@
#gpio-cells = <2>;
interrupt-parent = <&lsio_gpio2>;
interrupts = <5 IRQ_TYPE_EDGE_RISING>;
- power-domains = <&pd IMX_SC_R_BOARD_R4>;
};
pca9548_2: pca9548@70 {
@@ -478,7 +474,6 @@
#address-cells = <1>;
#size-cells = <0>;
reg = <0x70>;
- power-domains = <&pd IMX_SC_R_BOARD_R3>;
i2c@0 {
#address-cells = <1>;
diff --git a/drivers/clk/imx/clk-imx8qxp.c b/drivers/clk/imx/clk-imx8qxp.c
index c49c167a23ab..7fb34c2a803e 100644
--- a/drivers/clk/imx/clk-imx8qxp.c
+++ b/drivers/clk/imx/clk-imx8qxp.c
@@ -147,10 +147,10 @@ static int imx8qxp_clk_probe(struct platform_device *pdev)
imx_clk_scu("ftm1_clk", IMX_SC_R_FTM_1, IMX_SC_PM_CLK_PER);
imx_clk_scu("adc0_clk", IMX_SC_R_ADC_0, IMX_SC_PM_CLK_PER);
imx_clk_scu("pwm_clk", IMX_SC_R_LCD_0_PWM_0, IMX_SC_PM_CLK_PER);
+ imx_clk_scu("elcdif_pll", IMX_SC_R_ELCDIF_PLL, IMX_SC_PM_CLK_PLL);
imx_clk_scu2("lcd_clk", lcd_sels, ARRAY_SIZE(lcd_sels), IMX_SC_R_LCD_0, IMX_SC_PM_CLK_PER);
imx_clk_scu2("lcd_pxl_clk", lcd_pxl_sels, ARRAY_SIZE(lcd_pxl_sels), IMX_SC_R_LCD_0, IMX_SC_PM_CLK_MISC0);
imx_clk_scu("lcd_pxl_bypass_div_clk", IMX_SC_R_LCD_0, IMX_SC_PM_CLK_BYPASS);
- imx_clk_scu("elcdif_pll", IMX_SC_R_ELCDIF_PLL, IMX_SC_PM_CLK_PLL);
/* Audio SS */
diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c
index b19f22aab64a..a12e987ced62 100644
--- a/drivers/crypto/caam/ctrl.c
+++ b/drivers/crypto/caam/ctrl.c
@@ -79,6 +79,14 @@ static void build_deinstantiation_desc(u32 *desc, int handle)
append_jump(desc, JUMP_CLASS_CLASS1 | JUMP_TYPE_HALT);
}
+static const struct of_device_id imx8m_machine_match[] = {
+ { .compatible = "fsl,imx8mm", },
+ { .compatible = "fsl,imx8mn", },
+ { .compatible = "fsl,imx8mp", },
+ { .compatible = "fsl,imx8mq", },
+ { }
+};
+
/*
* run_descriptor_deco0 - runs a descriptor on DECO0, under direct control of
* the software (no JR/QI used).
@@ -850,6 +858,9 @@ static int caam_probe(struct platform_device *pdev)
nprop = pdev->dev.of_node;
imx_soc_match = soc_device_match(caam_imx_soc_table);
+ if (!imx_soc_match && of_match_node(imx8m_machine_match, of_root))
+ return -EPROBE_DEFER;
+
caam_imx = (bool)imx_soc_match;
#ifdef CONFIG_PM_SLEEP
diff --git a/drivers/firmware/imx/imx-scu-irq.c b/drivers/firmware/imx/imx-scu-irq.c
index 369621c14105..b4272a75a315 100644
--- a/drivers/firmware/imx/imx-scu-irq.c
+++ b/drivers/firmware/imx/imx-scu-irq.c
@@ -10,10 +10,11 @@
#include <linux/firmware/imx/sci.h>
#include <linux/mailbox_client.h>
#include <linux/suspend.h>
+#include <linux/sysfs.h>
+#include <linux/kobject.h>
#define IMX_SC_IRQ_FUNC_ENABLE 1
#define IMX_SC_IRQ_FUNC_STATUS 2
-#define IMX_SC_IRQ_NUM_GROUP 7
static u32 mu_resource_id;
@@ -39,6 +40,20 @@ struct imx_sc_msg_irq_enable {
u8 enable;
} __packed;
+struct scu_wakeup {
+ u32 mask;
+ u32 wakeup_src;
+ bool valid;
+};
+
+/* Sysfs functions */
+struct kobject *wakeup_obj;
+static ssize_t wakeup_source_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf);
+static struct kobj_attribute wakeup_source_attr = __ATTR(wakeup_src, 0660, wakeup_source_show, NULL);
+
+static struct scu_wakeup scu_irq_wakeup[IMX_SC_IRQ_NUM_GROUP];
+
+
static struct imx_sc_ipc *imx_sc_irq_ipc_handle;
static struct work_struct imx_sc_irq_work;
static BLOCKING_NOTIFIER_HEAD(imx_scu_irq_notifier_chain);
@@ -70,6 +85,10 @@ static void imx_scu_irq_work_handler(struct work_struct *work)
u8 i;
for (i = 0; i < IMX_SC_IRQ_NUM_GROUP; i++) {
+ if (scu_irq_wakeup[i].mask) {
+ scu_irq_wakeup[i].valid = false;
+ scu_irq_wakeup[i].wakeup_src = 0;
+ }
ret = imx_scu_irq_get_status(i, &irq_status);
if (ret) {
pr_err("get irq group %d status failed, ret %d\n",
@@ -79,7 +98,12 @@ static void imx_scu_irq_work_handler(struct work_struct *work)
if (!irq_status)
continue;
-
+ if (scu_irq_wakeup[i].mask & irq_status) {
+ scu_irq_wakeup[i].valid = true;
+ scu_irq_wakeup[i].wakeup_src = irq_status & scu_irq_wakeup[i].mask;
+ } else {
+ scu_irq_wakeup[i].wakeup_src = irq_status;
+ }
pm_system_wakeup();
imx_scu_irq_notifier_call_chain(irq_status, &i);
}
@@ -134,6 +158,11 @@ int imx_scu_irq_group_enable(u8 group, u32 mask, u8 enable)
pr_err("enable irq failed, group %d, mask %d, ret %d\n",
group, mask, ret);
+ if (enable)
+ scu_irq_wakeup[group].mask |= mask;
+ else
+ scu_irq_wakeup[group].mask &= ~mask;
+
return ret;
}
EXPORT_SYMBOL(imx_scu_irq_group_enable);
@@ -143,6 +172,24 @@ static void imx_scu_irq_callback(struct mbox_client *c, void *msg)
schedule_work(&imx_sc_irq_work);
}
+static ssize_t wakeup_source_show(struct kobject *kobj,
+ struct kobj_attribute *attr, char *buf)
+{
+ u8 i = 0, size = 0;
+
+ for (i = 0; i < IMX_SC_IRQ_NUM_GROUP; i++) {
+ if (scu_irq_wakeup[i].wakeup_src != 0) {
+ if (scu_irq_wakeup[i].valid)
+ size += sprintf(buf + size, "Wakeup source group = %d, irq = 0x%x\n",
+ i, scu_irq_wakeup[i].wakeup_src);
+ else
+ size += sprintf(buf + size, "Spurious SCU wakeup, group = %d, irq = 0x%x\n",
+ i, scu_irq_wakeup[i].wakeup_src);
+ }
+ }
+ return strlen(buf);
+}
+
int imx_scu_enable_general_irq_channel(struct device *dev)
{
struct of_phandle_args spec;
@@ -182,6 +229,15 @@ int imx_scu_enable_general_irq_channel(struct device *dev)
mu_resource_id = IMX_SC_R_MU_0A + i;
+ /* Create directory under /sysfs/firmware */
+ wakeup_obj = kobject_create_and_add("scu_wakeup_source", firmware_kobj);
+
+ if (sysfs_create_file(wakeup_obj, &wakeup_source_attr.attr)) {
+ pr_err("Cannot create sysfs file......\n");
+ kobject_put(wakeup_obj);
+ sysfs_remove_file(firmware_kobj, &wakeup_source_attr.attr);
+ }
+
return ret;
}
EXPORT_SYMBOL(imx_scu_enable_general_irq_channel);
diff --git a/drivers/firmware/imx/seco_mu.c b/drivers/firmware/imx/seco_mu.c
index d3633d0f286a..75744e4197f9 100644
--- a/drivers/firmware/imx/seco_mu.c
+++ b/drivers/firmware/imx/seco_mu.c
@@ -91,8 +91,6 @@
#define MAX_DATA_SIZE_PER_USER (65 * 1024)
-#define SC_IRQ_V2X_RESET (1<<7)
-
/* Header of the messages exchange with the SECO */
struct she_mu_hdr {
u8 ver;
@@ -1017,7 +1015,7 @@ static int imx_sc_v2x_reset_notify(struct notifier_block *nb,
struct seco_mu_device_ctx *dev_ctx = container_of(nb,
struct seco_mu_device_ctx, scu_notify);
- if (!(event & SC_IRQ_V2X_RESET))
+ if (!(event & IMX_SC_IRQ_V2X_RESET))
return 0;
dev_ctx->v2x_reset = true;
@@ -1179,7 +1177,7 @@ static int seco_mu_probe(struct platform_device *pdev)
}
ret = imx_scu_irq_group_enable(IMX_SC_IRQ_GROUP_WAKE,
- SC_IRQ_V2X_RESET, true);
+ IMX_SC_IRQ_V2X_RESET, true);
if (ret) {
dev_warn(&pdev->dev, "v2x Enable irq failed.\n");
return ret;
diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
index 0185b6e57e78..f7efac9a347b 100644
--- a/drivers/gpio/gpio-mxc.c
+++ b/drivers/gpio/gpio-mxc.c
@@ -30,7 +30,6 @@
#define IMX_SC_PAD_FUNC_GET_WAKEUP 9
#define IMX_SC_PAD_FUNC_SET_WAKEUP 4
#define IMX_SC_PAD_WAKEUP_OFF 0
-#define IMX_SC_IRQ_PAD (1 << 1)
#endif
enum mxc_gpio_hwtype {
diff --git a/drivers/gpu/drm/imx/mhdp/cdns-mhdp-imx8qm.c b/drivers/gpu/drm/imx/mhdp/cdns-mhdp-imx8qm.c
index 6173fda46403..9bfe5f08f4a3 100644
--- a/drivers/gpu/drm/imx/mhdp/cdns-mhdp-imx8qm.c
+++ b/drivers/gpu/drm/imx/mhdp/cdns-mhdp-imx8qm.c
@@ -373,63 +373,20 @@ static int imx8qm_ipg_clk_enable(struct imx_mhdp_device *imx_mhdp)
return ret;
}
-static int imx8qm_ipg_clk_disable(struct imx_mhdp_device *imx_mhdp)
+static void imx8qm_ipg_clk_disable(struct imx_mhdp_device *imx_mhdp)
{
- int ret;
struct imx_hdp_clks *clks = &imx_mhdp->clks;
- struct device *dev = imx_mhdp->mhdp.dev;
- ret = clk_prepare_enable(clks->clk_i2s_bypass);
- if (ret < 0) {
- dev_err(dev, "%s, pre clk i2s bypass error\n", __func__);
- return ret;
- }
- ret = clk_prepare_enable(clks->lpcg_i2s);
- if (ret < 0) {
- dev_err(dev, "%s, pre clk i2s error\n", __func__);
- return ret;
- }
- ret = clk_prepare_enable(clks->lpcg_apb_ctrl);
- if (ret < 0) {
- dev_err(dev, "%s, pre clk apb ctrl error\n", __func__);
- return ret;
- }
- ret = clk_prepare_enable(clks->lpcg_apb_csr);
- if (ret < 0) {
- dev_err(dev, "%s, pre clk apb csr error\n", __func__);
- return ret;
- }
- ret = clk_prepare_enable(clks->lpcg_msi);
- if (ret < 0) {
- dev_err(dev, "%s, pre clk msierror\n", __func__);
- return ret;
- }
- ret = clk_prepare_enable(clks->lpcg_lis);
- if (ret < 0) {
- dev_err(dev, "%s, pre clk lis error\n", __func__);
- return ret;
- }
- ret = clk_prepare_enable(clks->lpcg_apb);
- if (ret < 0) {
- dev_err(dev, "%s, pre clk apb error\n", __func__);
- return ret;
- }
- ret = clk_prepare_enable(clks->clk_core);
- if (ret < 0) {
- dev_err(dev, "%s, pre clk core error\n", __func__);
- return ret;
- }
- ret = clk_prepare_enable(clks->clk_ipg);
- if (ret < 0) {
- dev_err(dev, "%s, pre clk_ipg error\n", __func__);
- return ret;
- }
- ret = clk_prepare_enable(clks->dig_pll);
- if (ret < 0) {
- dev_err(dev, "%s, pre dig pll error\n", __func__);
- return ret;
- }
- return ret;
+ clk_disable_unprepare(clks->clk_i2s_bypass);
+ clk_disable_unprepare(clks->lpcg_i2s);
+ clk_disable_unprepare(clks->lpcg_apb_ctrl);
+ clk_disable_unprepare(clks->lpcg_apb_csr);
+ clk_disable_unprepare(clks->lpcg_msi);
+ clk_disable_unprepare(clks->lpcg_lis);
+ clk_disable_unprepare(clks->lpcg_apb);
+ clk_disable_unprepare(clks->clk_core);
+ clk_disable_unprepare(clks->clk_ipg);
+ clk_disable_unprepare(clks->dig_pll);
}
static void imx8qm_ipg_clk_set_rate(struct imx_mhdp_device *imx_mhdp)
diff --git a/drivers/gpu/drm/imx/mhdp/cdns-mhdp-imxdrv.c b/drivers/gpu/drm/imx/mhdp/cdns-mhdp-imxdrv.c
index 273275ed5831..ead56bed3574 100644
--- a/drivers/gpu/drm/imx/mhdp/cdns-mhdp-imxdrv.c
+++ b/drivers/gpu/drm/imx/mhdp/cdns-mhdp-imxdrv.c
@@ -222,6 +222,7 @@ static int cdns_mhdp_imx_resume(struct device *dev)
struct imx_mhdp_device *imx_mhdp = dev_get_drvdata(dev);
cdns_mhdp_plat_call(&imx_mhdp->mhdp, resume);
+ cdns_mhdp_plat_call(&imx_mhdp->mhdp, phy_set);
return 0;
}
diff --git a/drivers/gpu/drm/mxsfb/mxsfb_out.c b/drivers/gpu/drm/mxsfb/mxsfb_out.c
index 4eb94744c526..582e771cf726 100644
--- a/drivers/gpu/drm/mxsfb/mxsfb_out.c
+++ b/drivers/gpu/drm/mxsfb/mxsfb_out.c
@@ -92,7 +92,7 @@ int mxsfb_create_output(struct drm_device *drm)
&mxsfb_panel_connector_helper_funcs);
ret = drm_connector_init(drm, mxsfb->connector,
&mxsfb_panel_connector_funcs,
- DRM_MODE_CONNECTOR_Unknown);
+ DRM_MODE_CONNECTOR_DPI);
}
return ret;
diff --git a/drivers/mailbox/imx-mailbox.c b/drivers/mailbox/imx-mailbox.c
index df6a5930f79f..b620ed2aea44 100644
--- a/drivers/mailbox/imx-mailbox.c
+++ b/drivers/mailbox/imx-mailbox.c
@@ -12,6 +12,7 @@
#include <linux/module.h>
#include <linux/of_device.h>
#include <linux/pm_runtime.h>
+#include <linux/suspend.h>
#include <linux/slab.h>
#include <linux/jiffies.h>
@@ -67,6 +68,7 @@ struct imx_mu_priv {
const struct imx_mu_dcfg *dcfg;
struct clk *clk;
int irq;
+ bool suspend;
/* for control register save and restore */
u32 xcr;
@@ -374,6 +376,9 @@ static irqreturn_t imx_mu_isr(int irq, void *p)
return IRQ_NONE;
}
+ if (priv->suspend)
+ pm_system_irq_wakeup(priv->irq);
+
return IRQ_HANDLED;
}
@@ -634,7 +639,9 @@ static int imx_mu_suspend_noirq(struct device *dev)
if (!priv->clk)
priv->xcr = imx_mu_read(priv, priv->dcfg->xCR);
- return 0;
+ priv->suspend = true;
+
+ return 0;
}
static int imx_mu_resume_noirq(struct device *dev)
@@ -652,6 +659,8 @@ static int imx_mu_resume_noirq(struct device *dev)
if (!imx_mu_read(priv, priv->dcfg->xCR) && !priv->clk)
imx_mu_write(priv, priv->xcr, priv->dcfg->xCR);
+ priv->suspend = false;
+
return 0;
}
diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c
index 8537eccfd73a..4a4324fb5975 100644
--- a/drivers/remoteproc/imx_rproc.c
+++ b/drivers/remoteproc/imx_rproc.c
@@ -1274,7 +1274,7 @@ static int imx_rproc_probe(struct platform_device *pdev)
&priv->mub_partition))
priv->mub_partition = 3;
- ret = imx_scu_irq_group_enable(5, BIT(priv->mub_partition),
+ ret = imx_scu_irq_group_enable(IMX_SC_IRQ_GROUP_REBOOTED, BIT(priv->mub_partition),
true);
if (ret) {
dev_warn(dev, "Enable irq failed.\n");
@@ -1283,7 +1283,7 @@ static int imx_rproc_probe(struct platform_device *pdev)
ret = imx_scu_irq_register_notifier(&priv->proc_nb);
if (ret) {
- imx_scu_irq_group_enable(5, BIT(priv->mub_partition),
+ imx_scu_irq_group_enable(IMX_SC_IRQ_GROUP_REBOOTED, BIT(priv->mub_partition),
false);
dev_warn(dev, "reqister scu notifier failed.\n");
goto err_put_clk;
diff --git a/drivers/rpmsg/imx_rpmsg.c b/drivers/rpmsg/imx_rpmsg.c
index 9dd704ae5a64..b93df26bd21b 100644
--- a/drivers/rpmsg/imx_rpmsg.c
+++ b/drivers/rpmsg/imx_rpmsg.c
@@ -61,8 +61,6 @@ struct imx_rpmsg_vproc {
struct platform_device *pdev;
};
-#define SC_IRQ_GROUP_REBOOTED 5U /* Partition reboot complete */
-
/*
* The time consumption by remote ready is less than 1ms in the
* evaluation. Set the max wait timeout as 50ms here.
@@ -418,7 +416,7 @@ static int imx_rpmsg_partition_notify(struct notifier_block *nb,
/* Ignore other irqs */
if (!((event & BIT(rpdev->mub_partition)) &&
- (*(u8 *)group == SC_IRQ_GROUP_REBOOTED)))
+ (*(u8 *)group == IMX_SC_IRQ_GROUP_REBOOTED)))
return 0;
imx_rpmsg_restore(rpdev);
@@ -618,7 +616,7 @@ static int imx_rpmsg_probe(struct platform_device *pdev)
&rpdev->mub_partition))
rpdev->mub_partition = 3; /* default partition 3 */
- ret = imx_scu_irq_group_enable(SC_IRQ_GROUP_REBOOTED,
+ ret = imx_scu_irq_group_enable(IMX_SC_IRQ_GROUP_REBOOTED,
BIT(rpdev->mub_partition),
true);
if (ret) {
@@ -628,7 +626,7 @@ static int imx_rpmsg_probe(struct platform_device *pdev)
ret = imx_scu_irq_register_notifier(&rpdev->proc_nb);
if (ret) {
- imx_scu_irq_group_enable(SC_IRQ_GROUP_REBOOTED,
+ imx_scu_irq_group_enable(IMX_SC_IRQ_GROUP_REBOOTED,
BIT(rpdev->mub_partition),
false);
dev_warn(&pdev->dev, "reqister scu notifier failed.\n");
diff --git a/drivers/rtc/rtc-imx-sc.c b/drivers/rtc/rtc-imx-sc.c
index 531bfce65cd6..0207397f7f12 100644
--- a/drivers/rtc/rtc-imx-sc.c
+++ b/drivers/rtc/rtc-imx-sc.c
@@ -18,9 +18,6 @@
#define IMX_SIP_SRTC 0xC2000002
#define IMX_SIP_SRTC_SET_TIME 0x0
-#define SC_IRQ_GROUP_RTC 2
-#define SC_IRQ_RTC 1
-
static struct imx_sc_ipc *rtc_ipc_handle;
static struct rtc_device *imx_sc_rtc;
@@ -77,7 +74,7 @@ static int imx_sc_rtc_set_time(struct device *dev, struct rtc_time *tm)
static int imx_sc_rtc_alarm_irq_enable(struct device *dev, unsigned int enable)
{
- return imx_scu_irq_group_enable(SC_IRQ_GROUP_RTC, SC_IRQ_RTC, enable);
+ return imx_scu_irq_group_enable(IMX_SC_IRQ_GROUP_RTC, IMX_SC_IRQ_RTC, enable);
}
static int imx_sc_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
@@ -136,7 +133,7 @@ static int imx_sc_rtc_alarm_notify(struct notifier_block *nb,
unsigned long event, void *group)
{
/* ignore non-rtc irq */
- if (!((event & SC_IRQ_RTC) && (*(u8 *)group == SC_IRQ_GROUP_RTC)))
+ if (!((event & IMX_SC_IRQ_RTC) && (*(u8 *)group == IMX_SC_IRQ_GROUP_RTC)))
return 0;
rtc_update_irq(imx_sc_rtc, 1, RTC_IRQF | RTC_AF);
diff --git a/drivers/staging/media/imx/imx8-isi-cap.c b/drivers/staging/media/imx/imx8-isi-cap.c
index 6ba5b3a86f49..0960a8fa8af8 100644
--- a/drivers/staging/media/imx/imx8-isi-cap.c
+++ b/drivers/staging/media/imx/imx8-isi-cap.c
@@ -31,6 +31,8 @@
#include "imx8-common.h"
#define sd_to_cap_dev(ptr) container_of(ptr, struct mxc_isi_cap_dev, sd)
+static int mxc_isi_cap_streamoff(struct file *file, void *priv,
+ enum v4l2_buf_type type);
struct mxc_isi_fmt mxc_isi_out_formats[] = {
{
@@ -739,14 +741,19 @@ static int mxc_isi_capture_open(struct file *file)
static int mxc_isi_capture_release(struct file *file)
{
struct mxc_isi_cap_dev *isi_cap = video_drvdata(file);
+ struct video_device *vdev = video_devdata(file);
struct mxc_isi_dev *mxc_isi = mxc_isi_get_hostdata(isi_cap->pdev);
struct device *dev = &isi_cap->pdev->dev;
+ struct vb2_queue *q = vdev->queue;
struct v4l2_subdev *sd;
int ret = -1;
if (!isi_cap->is_link_setup)
return 0;
+ if (isi_cap->is_streaming[isi_cap->id])
+ mxc_isi_cap_streamoff(file, NULL, q->type);
+
sd = mxc_get_remote_subdev(&isi_cap->sd, __func__);
if (!sd)
goto label;
@@ -1078,6 +1085,7 @@ static int mxc_isi_cap_streamon(struct file *file, void *priv,
if (ret < 0 && ret != -ENOIOCTLCMD)
return ret;
+ isi_cap->is_streaming[isi_cap->id] = 1;
mxc_isi->is_streaming = 1;
return 0;
@@ -1096,6 +1104,7 @@ static int mxc_isi_cap_streamoff(struct file *file, void *priv,
mxc_isi_channel_disable(mxc_isi);
ret = vb2_ioctl_streamoff(file, priv, type);
+ isi_cap->is_streaming[isi_cap->id] = 0;
mxc_isi->is_streaming = 0;
return ret;
diff --git a/drivers/staging/media/imx/imx8-isi-core.h b/drivers/staging/media/imx/imx8-isi-core.h
index c955ec21c8d8..8ae41f8e6563 100644
--- a/drivers/staging/media/imx/imx8-isi-core.h
+++ b/drivers/staging/media/imx/imx8-isi-core.h
@@ -310,6 +310,7 @@ struct mxc_isi_cap_dev {
u32 frame_count;
u32 id;
+ u32 is_streaming[MXC_ISI_MAX_DEVS];
bool is_link_setup;
struct mutex lock;
diff --git a/drivers/watchdog/imx_sc_wdt.c b/drivers/watchdog/imx_sc_wdt.c
index 8c9936e78bee..46d534e3eab0 100644
--- a/drivers/watchdog/imx_sc_wdt.c
+++ b/drivers/watchdog/imx_sc_wdt.c
@@ -34,9 +34,6 @@
#define SC_TIMER_WDOG_ACTION_PARTITION 0
-#define SC_IRQ_WDOG 1
-#define SC_IRQ_GROUP_WDOG 1
-
static bool nowayout = WATCHDOG_NOWAYOUT;
module_param(nowayout, bool, 0000);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
@@ -123,8 +120,8 @@ static int imx_sc_wdt_notify(struct notifier_block *nb,
struct imx_sc_wdt_device,
wdt_notifier);
- if (event & SC_IRQ_WDOG &&
- *(u8 *)group == SC_IRQ_GROUP_WDOG)
+ if (event & IMX_SC_IRQ_WDOG &&
+ *(u8 *)group == IMX_SC_IRQ_GROUP_WDOG)
watchdog_notify_pretimeout(&imx_sc_wdd->wdd);
return 0;
@@ -135,8 +132,8 @@ static void imx_sc_wdt_action(void *data)
struct notifier_block *wdt_notifier = data;
imx_scu_irq_unregister_notifier(wdt_notifier);
- imx_scu_irq_group_enable(SC_IRQ_GROUP_WDOG,
- SC_IRQ_WDOG,
+ imx_scu_irq_group_enable(IMX_SC_IRQ_GROUP_WDOG,
+ IMX_SC_IRQ_WDOG,
false);
}
@@ -185,9 +182,9 @@ static int imx_sc_wdt_probe(struct platform_device *pdev)
watchdog_stop_on_reboot(wdog);
watchdog_stop_on_unregister(wdog);
- ret = imx_scu_irq_group_enable(SC_IRQ_GROUP_WDOG,
- SC_IRQ_WDOG,
- true);
+ ret = imx_scu_irq_group_enable(IMX_SC_IRQ_GROUP_WDOG,
+ IMX_SC_IRQ_WDOG,
+ true);
if (ret) {
dev_warn(dev, "Enable irq failed, pretimeout NOT supported\n");
goto register_device;
@@ -196,8 +193,8 @@ static int imx_sc_wdt_probe(struct platform_device *pdev)
imx_sc_wdd->wdt_notifier.notifier_call = imx_sc_wdt_notify;
ret = imx_scu_irq_register_notifier(&imx_sc_wdd->wdt_notifier);
if (ret) {
- imx_scu_irq_group_enable(SC_IRQ_GROUP_WDOG,
- SC_IRQ_WDOG,
+ imx_scu_irq_group_enable(IMX_SC_IRQ_GROUP_WDOG,
+ IMX_SC_IRQ_WDOG,
false);
dev_warn(dev,
"Register irq notifier failed, pretimeout NOT supported\n");
diff --git a/include/linux/firmware/imx/sci.h b/include/linux/firmware/imx/sci.h
index e749594436bb..70fe789aa842 100644
--- a/include/linux/firmware/imx/sci.h
+++ b/include/linux/firmware/imx/sci.h
@@ -17,12 +17,34 @@
#include <linux/firmware/imx/svc/rm.h>
#include <linux/firmware/imx/svc/seco.h>
-#define IMX_SC_IRQ_GROUP_WAKE 3U /* Wakeup interrupts */
+#define IMX_SC_IRQ_NUM_GROUP 9
+
+#define IMX_SC_IRQ_GROUP_TEMP 0 /* Temp interrupts */
+#define IMX_SC_IRQ_GROUP_WDOG 1 /* Watchdog interrupts */
+#define IMX_SC_IRQ_GROUP_RTC 2 /* RTC interrupts */
+#define IMX_SC_IRQ_GROUP_WAKE 3 /* Wakeup interrupts */
+#define IMX_SC_IRQ_GROUP_SYSCTR 4 /* System counter interrupts */
+#define IMX_SC_IRQ_GROUP_REBOOTED 5 /* Partition reboot complete */
+#define IMX_SC_IRQ_GROUP_REBOOT 6 /* Partition reboot starting */
+#define IMX_SC_IRQ_GROUP_OFFED 7 /* Partition off complete */
+#define IMX_SC_IRQ_GROUP_OFF 8 /* Partition off starting */
+
+#define IMX_SC_IRQ_RTC BIT(0) /* RTC interrupt */
+#define IMX_SC_IRQ_WDOG BIT(0) /* Watch Dog interrupt */
+#define IMX_SC_IRQ_SYSCTR BIT(0) /* System Counter interrupt */
+#define IMX_SC_IRQ_BUTTON BIT(0) /* Button interrupt */
+#define IMX_SC_IRQ_PAD BIT(1) /* Pad wakeup */
+#define IMX_SC_IRQ_USR1 BIT(2) /* User defined 1 */
+#define IMX_SC_IRQ_USR2 BIT(3) /* User defined 2 */
+#define IMX_SC_IRQ_BC_PAD BIT(4) /* Pad wakeup (broadcast to all partitions) */
+#define IMX_SC_IRQ_SW_WAKE BIT(5) /* Software requested wake */
#define IMX_SC_IRQ_SECVIO BIT(6) /* Security violation */
+#define IMX_SC_IRQ_V2X_RESET BIT(7) /* V2X reset */
int imx_scu_enable_general_irq_channel(struct device *dev);
int imx_scu_irq_register_notifier(struct notifier_block *nb);
int imx_scu_irq_unregister_notifier(struct notifier_block *nb);
int imx_scu_irq_group_enable(u8 group, u32 mask, u8 enable);
int imx_scu_irq_get_status(u8 group, u32 *irq_status);
+
#endif /* _SC_SCI_H */