Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * AS3711 PMIC MFC driver header
0004  *
0005  * Copyright (C) 2012 Renesas Electronics Corporation
0006  * Author: Guennadi Liakhovetski, <g.liakhovetski@gmx.de>
0007  */
0008 
0009 #ifndef MFD_AS3711_H
0010 #define MFD_AS3711_H
0011 
0012 /*
0013  * Client data
0014  */
0015 
0016 /* Register addresses */
0017 #define AS3711_SD_1_VOLTAGE     0   /* Digital Step-Down */
0018 #define AS3711_SD_2_VOLTAGE     1
0019 #define AS3711_SD_3_VOLTAGE     2
0020 #define AS3711_SD_4_VOLTAGE     3
0021 #define AS3711_LDO_1_VOLTAGE        4   /* Analog LDO */
0022 #define AS3711_LDO_2_VOLTAGE        5
0023 #define AS3711_LDO_3_VOLTAGE        6   /* Digital LDO */
0024 #define AS3711_LDO_4_VOLTAGE        7
0025 #define AS3711_LDO_5_VOLTAGE        8
0026 #define AS3711_LDO_6_VOLTAGE        9
0027 #define AS3711_LDO_7_VOLTAGE        0xa
0028 #define AS3711_LDO_8_VOLTAGE        0xb
0029 #define AS3711_SD_CONTROL       0x10
0030 #define AS3711_GPIO_SIGNAL_OUT      0x20
0031 #define AS3711_GPIO_SIGNAL_IN       0x21
0032 #define AS3711_SD_CONTROL_1     0x30
0033 #define AS3711_SD_CONTROL_2     0x31
0034 #define AS3711_CURR_CONTROL     0x40
0035 #define AS3711_CURR1_VALUE      0x43
0036 #define AS3711_CURR2_VALUE      0x44
0037 #define AS3711_CURR3_VALUE      0x45
0038 #define AS3711_STEPUP_CONTROL_1     0x50
0039 #define AS3711_STEPUP_CONTROL_2     0x51
0040 #define AS3711_STEPUP_CONTROL_4     0x53
0041 #define AS3711_STEPUP_CONTROL_5     0x54
0042 #define AS3711_REG_STATUS       0x73
0043 #define AS3711_INTERRUPT_STATUS_1   0x77
0044 #define AS3711_INTERRUPT_STATUS_2   0x78
0045 #define AS3711_INTERRUPT_STATUS_3   0x79
0046 #define AS3711_CHARGER_STATUS_1     0x86
0047 #define AS3711_CHARGER_STATUS_2     0x87
0048 #define AS3711_ASIC_ID_1        0x90
0049 #define AS3711_ASIC_ID_2        0x91
0050 
0051 #define AS3711_MAX_REG      AS3711_ASIC_ID_2
0052 #define AS3711_NUM_REGS     (AS3711_MAX_REG + 1)
0053 
0054 /* Regulators */
0055 enum {
0056     AS3711_REGULATOR_SD_1,
0057     AS3711_REGULATOR_SD_2,
0058     AS3711_REGULATOR_SD_3,
0059     AS3711_REGULATOR_SD_4,
0060     AS3711_REGULATOR_LDO_1,
0061     AS3711_REGULATOR_LDO_2,
0062     AS3711_REGULATOR_LDO_3,
0063     AS3711_REGULATOR_LDO_4,
0064     AS3711_REGULATOR_LDO_5,
0065     AS3711_REGULATOR_LDO_6,
0066     AS3711_REGULATOR_LDO_7,
0067     AS3711_REGULATOR_LDO_8,
0068 
0069     AS3711_REGULATOR_MAX,
0070 };
0071 
0072 struct device;
0073 struct regmap;
0074 
0075 struct as3711 {
0076     struct device *dev;
0077     struct regmap *regmap;
0078 };
0079 
0080 #define AS3711_MAX_STEPDOWN 4
0081 #define AS3711_MAX_STEPUP 2
0082 #define AS3711_MAX_LDO 8
0083 
0084 enum as3711_su2_feedback {
0085     AS3711_SU2_VOLTAGE,
0086     AS3711_SU2_CURR1,
0087     AS3711_SU2_CURR2,
0088     AS3711_SU2_CURR3,
0089     AS3711_SU2_CURR_AUTO,
0090 };
0091 
0092 enum as3711_su2_fbprot {
0093     AS3711_SU2_LX_SD4,
0094     AS3711_SU2_GPIO2,
0095     AS3711_SU2_GPIO3,
0096     AS3711_SU2_GPIO4,
0097 };
0098 
0099 /*
0100  * Platform data
0101  */
0102 
0103 struct as3711_regulator_pdata {
0104     struct regulator_init_data *init_data[AS3711_REGULATOR_MAX];
0105 };
0106 
0107 struct as3711_bl_pdata {
0108     bool su1_fb;
0109     int su1_max_uA;
0110     bool su2_fb;
0111     int su2_max_uA;
0112     enum as3711_su2_feedback su2_feedback;
0113     enum as3711_su2_fbprot su2_fbprot;
0114     bool su2_auto_curr1;
0115     bool su2_auto_curr2;
0116     bool su2_auto_curr3;
0117 };
0118 
0119 struct as3711_platform_data {
0120     struct as3711_regulator_pdata regulator;
0121     struct as3711_bl_pdata backlight;
0122 };
0123 
0124 #endif