Lines Matching +full:n +full:- +full:factor

1 // SPDX-License-Identifier: GPL-2.0-only
23 struct device *dev = &sc->pdev->dev; in sc_dump_regs()
25 #define DUMPREG(r) dev_dbg(dev, "%-35s %08x\n", #r, \ in sc_dump_regs()
26 ioread32(sc->base + CFG_##r)) in sc_dump_regs()
28 dev_dbg(dev, "SC Registers @ %pa:\n", &sc->res->start); in sc_dump_regs()
84 idx = HS_LT_9_16_SCALE + sixteenths - 8; in sc_set_hs_coeffs()
99 coeff_h += SC_NUM_TAPS_MEM_ALIGN - SC_H_NUM_TAPS; in sc_set_hs_coeffs()
102 sc->load_coeff_h = true; in sc_set_hs_coeffs()
127 idx = VS_LT_9_16_SCALE + sixteenths - 8; in sc_set_vs_coeffs()
140 coeff_v += SC_NUM_TAPS_MEM_ALIGN - SC_V_NUM_TAPS; in sc_set_vs_coeffs()
143 sc->load_coeff_v = true; in sc_set_vs_coeffs()
151 struct device *dev = &sc->pdev->dev; in sc_config_scaler()
158 u16 factor = 0; in sc_config_scaler() local
201 lltmp = dst_w - 1; in sc_config_scaler()
202 lin_acc_inc = div64_u64(((u64)(src_w >> dcm_shift) - 1) << 24, lltmp); in sc_config_scaler()
206 dev_dbg(dev, "hs config: src_w = %d, dst_w = %d, decimation = %s, lin_acc_inc = %08x\n", in sc_config_scaler()
222 factor = (u16) ((dst_h << 10) / src_h); in sc_config_scaler()
224 row_acc_init_rav = factor + ((1 + factor) >> 1); in sc_config_scaler()
226 row_acc_init_rav -= 1024; in sc_config_scaler()
229 (1 + (row_acc_init_rav >> 1)) - in sc_config_scaler()
237 …v_dbg(dev, "vs config(RAV): src_h = %d, dst_h = %d, factor = %d, acc_init = %08x, acc_init_b = %08… in sc_config_scaler()
238 src_h, dst_h, factor, row_acc_init_rav, in sc_config_scaler()
242 row_acc_inc = ((src_h - 1) << 16) / (dst_h - 1); in sc_config_scaler()
246 dev_dbg(dev, "vs config(POLY): src_h = %d, dst_h = %d,row_acc_inc = %08x\n", in sc_config_scaler()
269 *sc_reg13 = factor; in sc_config_scaler()
279 dev_dbg(&pdev->dev, "sc_create\n"); in sc_create()
281 sc = devm_kzalloc(&pdev->dev, sizeof(*sc), GFP_KERNEL); in sc_create()
283 dev_err(&pdev->dev, "couldn't alloc sc_data\n"); in sc_create()
284 return ERR_PTR(-ENOMEM); in sc_create()
287 sc->pdev = pdev; in sc_create()
289 sc->res = platform_get_resource_byname(pdev, IORESOURCE_MEM, res_name); in sc_create()
290 if (!sc->res) { in sc_create()
291 dev_err(&pdev->dev, "missing '%s' platform resources data\n", in sc_create()
293 return ERR_PTR(-ENODEV); in sc_create()
296 sc->base = devm_ioremap_resource(&pdev->dev, sc->res); in sc_create()
297 if (IS_ERR(sc->base)) in sc_create()
298 return ERR_CAST(sc->base); in sc_create()