#include <linux/smc.h>
#include <linux/ion_exynos.h>
-#include <linux/sched/clock.h>
-
#include <media/v4l2-ioctl.h>
#include <media/m2m1shot.h>
#include <media/m2m1shot-helper.h>
static int sc_runtime_suspend(struct device *dev)
{
struct sc_dev *sc = dev_get_drvdata(dev);
- const int *ptr = sc->q_reg;
- int i, idx;
-
- idx = sc->dbg_idx % SC_DEBUG_MAX_NUM;
- sc->qch_dbg[idx].time = sched_clock();
- for (i = 0; i < G2D_QCH_NUM; i++)
- sc->qch_dbg[idx].log[i] = ptr[i];
-
- sc->dbg_idx++;
-
if (sc->qosreq_int_level > 0)
pm_qos_update_request(&sc->qosreq_int, 0);
return 0;
}
}
- sc->q_reg = ioremap(0x13a07000, 0x100);
- if (sc->q_reg == NULL) {
- dev_err(&pdev->dev, "failed to ioremap address region\n");
- ret = -ENOENT;
- goto err_qch_reg;
- }
-
- sc->qch_dbg = kzalloc(sizeof(struct sc_qch_dbg) * SC_DEBUG_MAX_NUM, GFP_KERNEL);
- if (sc->qch_dbg == NULL) {
- ret = -ENOENT;
- goto err_qch_dbg;
- }
-
sc->version = SCALER_VERSION(2, 0, 0);
hwver = __raw_readl(sc->regs + SCALER_VER);
return 0;
-err_qch_dbg:
- iounmap(sc->q_reg);
-err_qch_reg:
- if (!IS_ERR(sc->aclk))
- clk_disable_unprepare(sc->aclk);
err_ver_aclk_get:
if (!IS_ERR(sc->pclk))
clk_disable_unprepare(sc->pclk);
{
struct sc_dev *sc = platform_get_drvdata(pdev);
- iounmap(sc->q_reg);
- kfree(sc->qch_dbg);
-
iovmm_deactivate(sc->dev);
sc_clk_put(sc);
#define SC_TIMEOUT (2 * HZ) /* 2 seconds */
#define SC_WDT_CNT 3
#define SC_MAX_CTRL_NUM 11
-#define SC_QCH_SIZE (sizeof(u32) * 21)
-#define SC_DEBUG_MAX_NUM 16
-#define G2D_QCH_NUM 21
#define SC_MAX_PLANES 3
/* Address index */
u32 h;
};
-struct sc_qch_dbg {
- unsigned long long time;
- u32 log[G2D_QCH_NUM];
-};
-
struct sc_qos_table {
unsigned int freq_mif;
unsigned int freq_int;
struct clk *clk_chld;
struct clk *clk_parn;
void __iomem *regs;
- void __iomem *q_reg;
struct resource *regs_res;
struct workqueue_struct *qosclr_int_wq;
wait_queue_head_t wait;
u32 version;
bool pb_disable;
u32 cfw;
- int dbg_idx;
- struct sc_qch_dbg *qch_dbg;
struct sc_qos_table *qos_table;
int qos_table_cnt;
};