u32 streamsize = smfc_get_streamsize(smfc);
u32 thumb_streamsize = smfc_get_2nd_streamsize(smfc);
+ smfc->flags &= ~SMFC_DEV_RUNNING;
+
if (!smfc_hwstatus_okay(smfc, ctx)) {
smfc_dump_registers(smfc);
state = VB2_BUF_STATE_ERROR;
smfc_hwconfigure_image(ctx);
smfc_configure_secondary_image(ctx);
smfc_hwconfigure_start(ctx);
+
+ ctx->smfc->flags |= SMFC_DEV_RUNNING;
}
static void smfc_m2m_job_abort(void *priv)
return ret;
}
+static int __attribute__((unused)) smfc_iommu_fault_handler(
+ struct iommu_domain *domain, struct device *dev,
+ unsigned long fault_addr, int fault_flags, void *token)
+{
+ struct smfc_dev *smfc = token;
+
+ if (smfc->flags & SMFC_DEV_RUNNING)
+ smfc_dump_registers(smfc);
+
+ return 0;
+}
+
static int exynos_smfc_probe(struct platform_device *pdev)
{
struct smfc_dev *smfc;
if (ret < 0)
return ret;
+ iovmm_set_fault_handler(&pdev->dev, smfc_iommu_fault_handler, smfc);
+
ret = iovmm_activate(&pdev->dev);
if (ret < 0)
return ret;
return fmt->bpp_buf[0] == 0;
}
+#define SMFC_DEV_RUNNING (1 << 0)
+
struct smfc_dev {
struct v4l2_device v4l2_dev;
struct video_device *videodev;
struct mutex video_device_mutex;
int device_id;
u32 hwver;
+ u32 flags;
struct clk *clk_gate;
struct clk *clk_gate2; /* available if clk_gate is valid */