struct platform_device *pdev;
struct resource *regs_res;
void __iomem *regs;
+ struct regmap *pmu_regmap;
int irq;
u32 id;
u32 debug_cnt;
int fimc_is_companion_close(struct fimc_is_device_companion *device)
{
int ret = 0;
- u32 timeout;
struct fimc_is_core *core = (struct fimc_is_core *)dev_get_drvdata(fimc_is_dev);
if (!core) {
err("core is NULL");
#if defined(CONFIG_PM_RUNTIME)
pm_runtime_put_sync(&device->pdev->dev);
+#if 0
if (core != NULL && !test_bit(FIMC_IS_ISCHAIN_POWER_ON, &core->state)) {
+ u32 timeout;
warn("only companion device closing after open..");
timeout = 2000;
while ((readl(PMUREG_CAM1_STATUS) & 0x1) && timeout) {
err("CAM1 power down failed(CAM1:0x%08x, A5:0x%08x)\n",
readl(PMUREG_CAM1_STATUS), readl(PMUREG_ISP_ARM_STATUS));
}
+#endif
#else
fimc_is_companion_runtime_suspend(&device->pdev->dev);
#endif /* CONFIG_PM_RUNTIME */
#include <linux/vmalloc.h>
#include <linux/kthread.h>
#include <linux/debugfs.h>
+#include <linux/regmap.h>
#include <linux/syscalls.h>
#include <linux/bug.h>
mwarn("calibration loading is success", device);
return ret;
}
+
static void fimc_is_ischain_forcedown(struct fimc_is_device_ischain *this,
bool on)
{
+#if 0
if (on) {
printk(KERN_INFO "Set low poweroff mode\n");
__raw_writel(0x0, PMUREG_ISP_ARM_OPTION);
__raw_writel(0x8, PMUREG_ISP_LOW_POWER_OFF);
this->force_down = false;
}
+#endif
}
static void fimc_is_a5_power(struct device *dev, int power_flags)
{
- u32 timeout;
+ struct fimc_is_core *core;
+ int timeout;
+ u32 val;
+
+ if (!fimc_is_dev) {
+ err("fimc_is_dev is not yet probed");
+ BUG();
+ }
+
+ core = (struct fimc_is_core *)dev_get_drvdata(fimc_is_dev);
+ if (!core) {
+ err("core is NULL");
+ BUG();
+ }
/* configuration */
- __raw_writel(power_flags, PMUREG_ISP_ARM_CONFIGURATION);
+ regmap_write(core->pmu_regmap, PMUREG_ISP_ARM_CONFIGURATION, power_flags);
/* option */
if (power_flags) {
/* A5 enable[15] */
- writel((1 << 15), PMUREG_ISP_ARM_OPTION);
+ regmap_write(core->pmu_regmap, PMUREG_ISP_ARM_OPTION, (1 << 15));
}
/* status */
timeout = 1000;
- while ((__raw_readl(PMUREG_ISP_ARM_STATUS) & 0x1) != power_flags) {
- if (timeout == 0)
- err("%s can't control power(%d), timeout\n", __func__, power_flags);
- timeout--;
- udelay(1);
+ while (timeout) {
+ regmap_read(core->pmu_regmap, PMUREG_ISP_ARM_STATUS, &val);
+ if ((val & 0x1) != power_flags) {
+ timeout--;
+ udelay(1);
+ } else {
+ break;
+ }
}
+ if (timeout == 0)
+ err("%s can't control power(%d), timeout\n", __func__, power_flags);
}
int fimc_is_ischain_power(struct fimc_is_device_ischain *device, int on)
merr("secure configuration is fail[0x131E0004:%08X]", device, debug);
/* To guarantee FW restart */
- if (__raw_readl(PMUREG_ISP_ARM_STATUS) & 0x1) {
+ regmap_read(core->pmu_regmap, PMUREG_ISP_ARM_STATUS, &val);
+ if (val & 0x1) {
fimc_is_a5_power(dev, 0);
}
#include <media/exynos_mc.h>
#include <linux/of.h>
#include <linux/of_gpio.h>
+#include <linux/regmap.h>
+#include <linux/mfd/syscon.h>
#include "fimc-is-core.h"
#include "fimc-is-dt.h"
if (i >= 0 || i < FIMC_IS_MAX_NODES)
core->csis_np[i] = child;
}
+
+ core->pmu_regmap = syscon_regmap_lookup_by_phandle(np,
+ "samsung,pmureg-phandle");
+
return 0;
}
int fimc_is_runtime_suspend_post(struct device *dev)
{
int ret = 0;
+#if 0
u32 timeout;
timeout = 2000;
err("CAM1 power down failed(CAM1:0x%08x, A5:0x%08x)\n",
readl(PMUREG_CAM1_STATUS), readl(PMUREG_ISP_ARM_STATUS));
-
+#endif
return ret;
}
#define ISSR62 (MCUCTL+0x178)
#define ISSR63 (MCUCTL+0x17c)
-#define PMUREG_ISP_ARM_CONFIGURATION (S5P_VA_PMU + 0x2580)
-#define PMUREG_ISP_ARM_STATUS (S5P_VA_PMU + 0x2584)
-#define PMUREG_ISP_ARM_OPTION (S5P_VA_PMU + 0x2588)
-#define PMUREG_ISP_LOW_POWER_OFF (S5P_VA_PMU + 0x0004)
-#define PMUREG_ISP_CONFIGURATION (S5P_VA_PMU + 0x4140)
-#define PMUREG_ISP_STATUS (S5P_VA_PMU + 0x4144)
-
-#define PMUREG_CAM0_STATUS (S5P_VA_PMU + 0x4024)
-#define PMUREG_CAM1_STATUS (S5P_VA_PMU + 0x40A4)
+#define PMUREG_ISP_ARM_CONFIGURATION (0x2580)
+#define PMUREG_ISP_ARM_STATUS (0x2584)
+#define PMUREG_ISP_ARM_OPTION (0x2588)
+#define PMUREG_ISP_LOW_POWER_OFF (0x0004)
+#define PMUREG_ISP_CONFIGURATION (0x4140)
+#define PMUREG_ISP_STATUS (0x4144)
#define SYSREG_GSCBLK_CFG1 (S3C_VA_SYS + 0x0224)
#define SYSREG_ISPBLK_CFG (S3C_VA_SYS + 0x022C)
-
/* GIC for FIMC-IS*/
#define PA_FIMC_IS_GIC_C (0x141E0000)
#define PA_FIMC_IS_GIC_D (0x141F0000)