diff options
Diffstat (limited to 'drivers/media/platform/ti-vpe/sc.c')
-rw-r--r-- | drivers/media/platform/ti-vpe/sc.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/drivers/media/platform/ti-vpe/sc.c b/drivers/media/platform/ti-vpe/sc.c index f82d1c7f667f..e9273b713782 100644 --- a/drivers/media/platform/ti-vpe/sc.c +++ b/drivers/media/platform/ti-vpe/sc.c @@ -14,6 +14,7 @@ #include <linux/err.h> #include <linux/io.h> +#include <linux/module.h> #include <linux/platform_device.h> #include <linux/slab.h> @@ -27,6 +28,8 @@ void sc_dump_regs(struct sc_data *sc) #define DUMPREG(r) dev_dbg(dev, "%-35s %08x\n", #r, \ ioread32(sc->base + CFG_##r)) + dev_dbg(dev, "SC Registers @ %pa:\n", &sc->res->start); + DUMPREG(SC0); DUMPREG(SC1); DUMPREG(SC2); @@ -52,6 +55,7 @@ void sc_dump_regs(struct sc_data *sc) #undef DUMPREG } +EXPORT_SYMBOL(sc_dump_regs); /* * set the horizontal scaler coefficients according to the ratio of output to @@ -84,9 +88,6 @@ void sc_set_hs_coeffs(struct sc_data *sc, void *addr, unsigned int src_w, } } - if (idx == sc->hs_index) - return; - cp = scaler_hs_coeffs[idx]; for (i = 0; i < SC_NUM_PHASES * 2; i++) { @@ -101,10 +102,9 @@ void sc_set_hs_coeffs(struct sc_data *sc, void *addr, unsigned int src_w, coeff_h += SC_NUM_TAPS_MEM_ALIGN - SC_H_NUM_TAPS; } - sc->hs_index = idx; - sc->load_coeff_h = true; } +EXPORT_SYMBOL(sc_set_hs_coeffs); /* * set the vertical scaler coefficients according to the ratio of output to @@ -130,9 +130,6 @@ void sc_set_vs_coeffs(struct sc_data *sc, void *addr, unsigned int src_h, idx = VS_LT_9_16_SCALE + sixteenths - 8; } - if (idx == sc->vs_index) - return; - cp = scaler_vs_coeffs[idx]; for (i = 0; i < SC_NUM_PHASES * 2; i++) { @@ -146,9 +143,9 @@ void sc_set_vs_coeffs(struct sc_data *sc, void *addr, unsigned int src_h, coeff_v += SC_NUM_TAPS_MEM_ALIGN - SC_V_NUM_TAPS; } - sc->vs_index = idx; sc->load_coeff_v = true; } +EXPORT_SYMBOL(sc_set_vs_coeffs); void sc_config_scaler(struct sc_data *sc, u32 *sc_reg0, u32 *sc_reg8, u32 *sc_reg17, unsigned int src_w, unsigned int src_h, @@ -276,8 +273,9 @@ void sc_config_scaler(struct sc_data *sc, u32 *sc_reg0, u32 *sc_reg8, *sc_reg24 = (src_w << CFG_ORG_W_SHIFT) | (src_h << CFG_ORG_H_SHIFT); } +EXPORT_SYMBOL(sc_config_scaler); -struct sc_data *sc_create(struct platform_device *pdev) +struct sc_data *sc_create(struct platform_device *pdev, const char *res_name) { struct sc_data *sc; @@ -291,9 +289,10 @@ struct sc_data *sc_create(struct platform_device *pdev) sc->pdev = pdev; - sc->res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "sc"); + sc->res = platform_get_resource_byname(pdev, IORESOURCE_MEM, res_name); if (!sc->res) { - dev_err(&pdev->dev, "missing platform resources data\n"); + dev_err(&pdev->dev, "missing '%s' platform resources data\n", + res_name); return ERR_PTR(-ENODEV); } @@ -305,3 +304,8 @@ struct sc_data *sc_create(struct platform_device *pdev) return sc; } +EXPORT_SYMBOL(sc_create); + +MODULE_DESCRIPTION("TI VIP/VPE Scaler"); +MODULE_AUTHOR("Texas Instruments Inc."); +MODULE_LICENSE("GPL v2"); |