Re: [PATCH 1/6] OMAPDSS: DISPC: cleanup cpu_is_xxxx checks
- From
- Mahapatra, Chandrabhanu <hidden>
- Date
- 2012-08-14 12:15:30
- Also in
- linux-omap
- Reply to
- Chandrabhanu Mahapatra, 2012-08-13
quoted hunk ↗ jump to hunk
+static const struct __initdata dispc_features omap2_dispc_features = { + .hp_max = 256, + .vp_max = 255, + .sw_max = 64, + .sw_start = 5, + .fp_start = 15, + .bp_start = 27, + .calc_scaling = dispc_ovl_calc_scaling_24xx, + .calc_core_clk = calc_core_clk_24xx, +}; + +static const struct __initdata dispc_features omap3_2_1_dispc_features = { + .hp_max = 256, + .vp_max = 255, + .sw_max = 64, + .sw_start = 5, + .fp_start = 15, + .bp_start = 27, + .calc_scaling = dispc_ovl_calc_scaling_34xx, + .calc_core_clk = calc_core_clk_34xx, +}; + +static const struct __initdata dispc_features omap3_3_0_dispc_features = { + .hp_max = 4096, + .vp_max = 4095, + .sw_max = 256, + .sw_start = 7, + .fp_start = 19, + .bp_start = 31, + .calc_scaling = dispc_ovl_calc_scaling_34xx, + .calc_core_clk = calc_core_clk_34xx, +}; + +static const struct __initdata dispc_features omap4_dispc_features = { + .hp_max = 4096, + .vp_max = 4095, + .sw_max = 256, + .sw_start = 7, + .fp_start = 19, + .bp_start = 31, + .calc_scaling = dispc_ovl_calc_scaling_44xx, + .calc_core_clk = calc_core_clk_44xx, +}; +
Here the dispc_features not only mention the omap name but also the
revision like omap3_3_0_dispc_features which initializes data for
OMAP3430_REV_ES3_0 and higher. May be omap34xx_rev3_0_dispc_features
is a better name for this. For others omap44xx_dispc_features kind of
name should be ok without revision number being mentioned. What d you
say?
quoted hunk ↗ jump to hunk
+static int __init dispc_init_features(struct device *dev) +{ + dispc.feat = devm_kzalloc(dev, sizeof(*dispc.feat), GFP_KERNEL); + if (!dispc.feat) { + dev_err(dev, "Failed to allocate DISPC Features\n"); + return -ENOMEM; + } + + if (cpu_is_omap24xx()) { + dispc.feat = &omap2_dispc_features; + } else if (cpu_is_omap34xx()) { + if (omap_rev() < OMAP3430_REV_ES3_0) + dispc.feat = &omap3_2_1_dispc_features; + else + dispc.feat = &omap3_3_0_dispc_features; + } else { + dispc.feat = &omap4_dispc_features; + } + + return 0; +} +
-- Chandrabhanu Mahapatra Texas Instruments India Pvt. Ltd.