Lines Matching +full:rcar +full:- +full:gen3 +full:- +full:cmm
1 // SPDX-License-Identifier: GPL-2.0+
3 * R-Car Display Unit Color Management Module
27 * @lut: 1D-LUT state
28 * @lut.enabled: 1D-LUT enabled flag
37 return ioread32(rcmm->base + reg); in rcar_cmm_read()
42 iowrite32(data, rcmm->base + reg); in rcar_cmm_write()
46 * rcar_cmm_lut_write() - Scale the DRM LUT table entries to hardware precision
47 * and write to the CMM registers
48 * @rcmm: Pointer to the CMM device
66 * rcar_cmm_setup() - Configure the CMM unit
67 * @pdev: The platform device associated with the CMM instance
68 * @config: The CMM unit configuration
70 * Configure the CMM unit with the given configuration. Currently enabling,
71 * disabling and programming of the 1-D LUT unit is supported.
73 * As rcar_cmm_setup() accesses the CMM registers the unit should be powered
75 * this function is made, the CMM unit has to be enabled by calling
87 if (!config->lut.table) { in rcar_cmm_setup()
88 if (rcmm->lut.enabled) { in rcar_cmm_setup()
90 rcmm->lut.enabled = false; in rcar_cmm_setup()
97 if (!rcmm->lut.enabled) { in rcar_cmm_setup()
99 rcmm->lut.enabled = true; in rcar_cmm_setup()
102 rcar_cmm_lut_write(rcmm, config->lut.table); in rcar_cmm_setup()
109 * rcar_cmm_enable() - Enable the CMM unit
110 * @pdev: The platform device associated with the CMM instance
112 * When the output of the corresponding DU channel is routed to the CMM unit,
114 * enabled until the channel is stopped. The CMM unit shall be disabled with
117 * Calls to rcar_cmm_enable() and rcar_cmm_disable() are not reference-counted.
118 * It is an error to attempt to enable an already enabled CMM unit, or to
125 ret = pm_runtime_resume_and_get(&pdev->dev); in rcar_cmm_enable()
134 * rcar_cmm_disable() - Disable the CMM unit
135 * @pdev: The platform device associated with the CMM instance
139 * Disabling the CMM unit disable all the internal processing blocks. The CMM
140 * state shall thus be restored with rcar_cmm_setup() when re-enabling the CMM
148 rcmm->lut.enabled = false; in rcar_cmm_disable()
150 pm_runtime_put(&pdev->dev); in rcar_cmm_disable()
155 * rcar_cmm_init() - Initialize the CMM unit
156 * @pdev: The platform device associated with the CMM instance
158 * Return: 0 on success, -EPROBE_DEFER if the CMM is not available yet,
159 * -ENODEV if the DRM_RCAR_CMM config option is disabled
166 return -EPROBE_DEFER; in rcar_cmm_init()
176 rcmm = devm_kzalloc(&pdev->dev, sizeof(*rcmm), GFP_KERNEL); in rcar_cmm_probe()
178 return -ENOMEM; in rcar_cmm_probe()
181 rcmm->base = devm_platform_ioremap_resource(pdev, 0); in rcar_cmm_probe()
182 if (IS_ERR(rcmm->base)) in rcar_cmm_probe()
183 return PTR_ERR(rcmm->base); in rcar_cmm_probe()
185 pm_runtime_enable(&pdev->dev); in rcar_cmm_probe()
192 pm_runtime_disable(&pdev->dev); in rcar_cmm_remove()
196 { .compatible = "renesas,rcar-gen3-cmm", },
197 { .compatible = "renesas,rcar-gen2-cmm", },
206 .name = "rcar-cmm",
214 MODULE_DESCRIPTION("Renesas R-Car CMM Driver");