Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Copyright (C) 2014 Free Electrons
0004  * Copyright (C) 2014 Atmel
0005  *
0006  * Author: Boris BREZILLON <boris.brezillon@free-electrons.com>
0007  */
0008 
0009 #ifndef __LINUX_MFD_HLCDC_H
0010 #define __LINUX_MFD_HLCDC_H
0011 
0012 #include <linux/clk.h>
0013 #include <linux/regmap.h>
0014 
0015 #define ATMEL_HLCDC_CFG(i)      ((i) * 0x4)
0016 #define ATMEL_HLCDC_SIG_CFG     LCDCFG(5)
0017 #define ATMEL_HLCDC_HSPOL       BIT(0)
0018 #define ATMEL_HLCDC_VSPOL       BIT(1)
0019 #define ATMEL_HLCDC_VSPDLYS     BIT(2)
0020 #define ATMEL_HLCDC_VSPDLYE     BIT(3)
0021 #define ATMEL_HLCDC_DISPPOL     BIT(4)
0022 #define ATMEL_HLCDC_DITHER      BIT(6)
0023 #define ATMEL_HLCDC_DISPDLY     BIT(7)
0024 #define ATMEL_HLCDC_MODE_MASK       GENMASK(9, 8)
0025 #define ATMEL_HLCDC_PP          BIT(10)
0026 #define ATMEL_HLCDC_VSPSU       BIT(12)
0027 #define ATMEL_HLCDC_VSPHO       BIT(13)
0028 #define ATMEL_HLCDC_GUARDTIME_MASK  GENMASK(20, 16)
0029 
0030 #define ATMEL_HLCDC_EN          0x20
0031 #define ATMEL_HLCDC_DIS         0x24
0032 #define ATMEL_HLCDC_SR          0x28
0033 #define ATMEL_HLCDC_IER         0x2c
0034 #define ATMEL_HLCDC_IDR         0x30
0035 #define ATMEL_HLCDC_IMR         0x34
0036 #define ATMEL_HLCDC_ISR         0x38
0037 
0038 #define ATMEL_HLCDC_CLKPOL      BIT(0)
0039 #define ATMEL_HLCDC_CLKSEL      BIT(2)
0040 #define ATMEL_HLCDC_CLKPWMSEL       BIT(3)
0041 #define ATMEL_HLCDC_CGDIS(i)        BIT(8 + (i))
0042 #define ATMEL_HLCDC_CLKDIV_SHFT     16
0043 #define ATMEL_HLCDC_CLKDIV_MASK     GENMASK(23, 16)
0044 #define ATMEL_HLCDC_CLKDIV(div)     ((div - 2) << ATMEL_HLCDC_CLKDIV_SHFT)
0045 
0046 #define ATMEL_HLCDC_PIXEL_CLK       BIT(0)
0047 #define ATMEL_HLCDC_SYNC        BIT(1)
0048 #define ATMEL_HLCDC_DISP        BIT(2)
0049 #define ATMEL_HLCDC_PWM         BIT(3)
0050 #define ATMEL_HLCDC_SIP         BIT(4)
0051 
0052 #define ATMEL_HLCDC_SOF         BIT(0)
0053 #define ATMEL_HLCDC_SYNCDIS     BIT(1)
0054 #define ATMEL_HLCDC_FIFOERR     BIT(4)
0055 #define ATMEL_HLCDC_LAYER_STATUS(x) BIT((x) + 8)
0056 
0057 /**
0058  * Structure shared by the MFD device and its subdevices.
0059  *
0060  * @regmap: register map used to access HLCDC IP registers
0061  * @periph_clk: the hlcdc peripheral clock
0062  * @sys_clk: the hlcdc system clock
0063  * @slow_clk: the system slow clk
0064  * @irq: the hlcdc irq
0065  */
0066 struct atmel_hlcdc {
0067     struct regmap *regmap;
0068     struct clk *periph_clk;
0069     struct clk *sys_clk;
0070     struct clk *slow_clk;
0071     int irq;
0072 };
0073 
0074 #endif /* __LINUX_MFD_HLCDC_H */