1*11696c5eSBiju Das /* SPDX-License-Identifier: GPL-2.0+ */ 2*11696c5eSBiju Das /* 3*11696c5eSBiju Das * R-Car Display Unit Color Management Module 4*11696c5eSBiju Das * 5*11696c5eSBiju Das * Copyright (C) 2019 Jacopo Mondi <jacopo+renesas@jmondi.org> 6*11696c5eSBiju Das */ 7*11696c5eSBiju Das 8*11696c5eSBiju Das #ifndef __RCAR_CMM_H__ 9*11696c5eSBiju Das #define __RCAR_CMM_H__ 10*11696c5eSBiju Das 11*11696c5eSBiju Das #define CM2_LUT_SIZE 256 12*11696c5eSBiju Das 13*11696c5eSBiju Das struct drm_color_lut; 14*11696c5eSBiju Das struct platform_device; 15*11696c5eSBiju Das 16*11696c5eSBiju Das /** 17*11696c5eSBiju Das * struct rcar_cmm_config - CMM configuration 18*11696c5eSBiju Das * 19*11696c5eSBiju Das * @lut: 1D-LUT configuration 20*11696c5eSBiju Das * @lut.table: 1D-LUT table entries. Disable LUT operations when NULL 21*11696c5eSBiju Das */ 22*11696c5eSBiju Das struct rcar_cmm_config { 23*11696c5eSBiju Das struct { 24*11696c5eSBiju Das struct drm_color_lut *table; 25*11696c5eSBiju Das } lut; 26*11696c5eSBiju Das }; 27*11696c5eSBiju Das 28*11696c5eSBiju Das #if IS_ENABLED(CONFIG_DRM_RCAR_CMM) 29*11696c5eSBiju Das int rcar_cmm_init(struct platform_device *pdev); 30*11696c5eSBiju Das 31*11696c5eSBiju Das int rcar_cmm_enable(struct platform_device *pdev); 32*11696c5eSBiju Das void rcar_cmm_disable(struct platform_device *pdev); 33*11696c5eSBiju Das 34*11696c5eSBiju Das int rcar_cmm_setup(struct platform_device *pdev, 35*11696c5eSBiju Das const struct rcar_cmm_config *config); 36*11696c5eSBiju Das #else rcar_cmm_init(struct platform_device * pdev)37*11696c5eSBiju Dasstatic inline int rcar_cmm_init(struct platform_device *pdev) 38*11696c5eSBiju Das { 39*11696c5eSBiju Das return -ENODEV; 40*11696c5eSBiju Das } 41*11696c5eSBiju Das rcar_cmm_enable(struct platform_device * pdev)42*11696c5eSBiju Dasstatic inline int rcar_cmm_enable(struct platform_device *pdev) 43*11696c5eSBiju Das { 44*11696c5eSBiju Das return 0; 45*11696c5eSBiju Das } 46*11696c5eSBiju Das rcar_cmm_disable(struct platform_device * pdev)47*11696c5eSBiju Dasstatic inline void rcar_cmm_disable(struct platform_device *pdev) 48*11696c5eSBiju Das { 49*11696c5eSBiju Das } 50*11696c5eSBiju Das rcar_cmm_setup(struct platform_device * pdev,const struct rcar_cmm_config * config)51*11696c5eSBiju Dasstatic inline int rcar_cmm_setup(struct platform_device *pdev, 52*11696c5eSBiju Das const struct rcar_cmm_config *config) 53*11696c5eSBiju Das { 54*11696c5eSBiju Das return 0; 55*11696c5eSBiju Das } 56*11696c5eSBiju Das #endif /* IS_ENABLED(CONFIG_DRM_RCAR_CMM) */ 57*11696c5eSBiju Das 58*11696c5eSBiju Das #endif /* __RCAR_CMM_H__ */ 59