1 /* SPDX-License-Identifier: GPL-2.0-only */ << 2 /* 1 /* 3 * AS3711 PMIC MFC driver header 2 * AS3711 PMIC MFC driver header 4 * 3 * 5 * Copyright (C) 2012 Renesas Electronics Corp 4 * Copyright (C) 2012 Renesas Electronics Corporation 6 * Author: Guennadi Liakhovetski, <g.liakhovet 5 * Author: Guennadi Liakhovetski, <g.liakhovetski@gmx.de> >> 6 * >> 7 * This program is free software; you can redistribute it and/or modify >> 8 * it under the terms of the version 2 of the GNU General Public License as >> 9 * published by the Free Software Foundation 7 */ 10 */ 8 11 9 #ifndef MFD_AS3711_H 12 #ifndef MFD_AS3711_H 10 #define MFD_AS3711_H 13 #define MFD_AS3711_H 11 14 12 /* 15 /* 13 * Client data 16 * Client data 14 */ 17 */ 15 18 16 /* Register addresses */ 19 /* Register addresses */ 17 #define AS3711_SD_1_VOLTAGE 0 20 #define AS3711_SD_1_VOLTAGE 0 /* Digital Step-Down */ 18 #define AS3711_SD_2_VOLTAGE 1 21 #define AS3711_SD_2_VOLTAGE 1 19 #define AS3711_SD_3_VOLTAGE 2 22 #define AS3711_SD_3_VOLTAGE 2 20 #define AS3711_SD_4_VOLTAGE 3 23 #define AS3711_SD_4_VOLTAGE 3 21 #define AS3711_LDO_1_VOLTAGE 4 24 #define AS3711_LDO_1_VOLTAGE 4 /* Analog LDO */ 22 #define AS3711_LDO_2_VOLTAGE 5 25 #define AS3711_LDO_2_VOLTAGE 5 23 #define AS3711_LDO_3_VOLTAGE 6 26 #define AS3711_LDO_3_VOLTAGE 6 /* Digital LDO */ 24 #define AS3711_LDO_4_VOLTAGE 7 27 #define AS3711_LDO_4_VOLTAGE 7 25 #define AS3711_LDO_5_VOLTAGE 8 28 #define AS3711_LDO_5_VOLTAGE 8 26 #define AS3711_LDO_6_VOLTAGE 9 29 #define AS3711_LDO_6_VOLTAGE 9 27 #define AS3711_LDO_7_VOLTAGE 0xa 30 #define AS3711_LDO_7_VOLTAGE 0xa 28 #define AS3711_LDO_8_VOLTAGE 0xb 31 #define AS3711_LDO_8_VOLTAGE 0xb 29 #define AS3711_SD_CONTROL 0x10 32 #define AS3711_SD_CONTROL 0x10 30 #define AS3711_GPIO_SIGNAL_OUT 0x20 33 #define AS3711_GPIO_SIGNAL_OUT 0x20 31 #define AS3711_GPIO_SIGNAL_IN 0x21 34 #define AS3711_GPIO_SIGNAL_IN 0x21 32 #define AS3711_SD_CONTROL_1 0x30 35 #define AS3711_SD_CONTROL_1 0x30 33 #define AS3711_SD_CONTROL_2 0x31 36 #define AS3711_SD_CONTROL_2 0x31 34 #define AS3711_CURR_CONTROL 0x40 37 #define AS3711_CURR_CONTROL 0x40 35 #define AS3711_CURR1_VALUE 0x43 38 #define AS3711_CURR1_VALUE 0x43 36 #define AS3711_CURR2_VALUE 0x44 39 #define AS3711_CURR2_VALUE 0x44 37 #define AS3711_CURR3_VALUE 0x45 40 #define AS3711_CURR3_VALUE 0x45 38 #define AS3711_STEPUP_CONTROL_1 0x50 41 #define AS3711_STEPUP_CONTROL_1 0x50 39 #define AS3711_STEPUP_CONTROL_2 0x51 42 #define AS3711_STEPUP_CONTROL_2 0x51 40 #define AS3711_STEPUP_CONTROL_4 0x53 43 #define AS3711_STEPUP_CONTROL_4 0x53 41 #define AS3711_STEPUP_CONTROL_5 0x54 44 #define AS3711_STEPUP_CONTROL_5 0x54 42 #define AS3711_REG_STATUS 0x73 45 #define AS3711_REG_STATUS 0x73 43 #define AS3711_INTERRUPT_STATUS_1 0x77 46 #define AS3711_INTERRUPT_STATUS_1 0x77 44 #define AS3711_INTERRUPT_STATUS_2 0x78 47 #define AS3711_INTERRUPT_STATUS_2 0x78 45 #define AS3711_INTERRUPT_STATUS_3 0x79 48 #define AS3711_INTERRUPT_STATUS_3 0x79 46 #define AS3711_CHARGER_STATUS_1 0x86 49 #define AS3711_CHARGER_STATUS_1 0x86 47 #define AS3711_CHARGER_STATUS_2 0x87 50 #define AS3711_CHARGER_STATUS_2 0x87 48 #define AS3711_ASIC_ID_1 0x90 51 #define AS3711_ASIC_ID_1 0x90 49 #define AS3711_ASIC_ID_2 0x91 52 #define AS3711_ASIC_ID_2 0x91 50 53 51 #define AS3711_MAX_REG AS3711_ASIC_ID 54 #define AS3711_MAX_REG AS3711_ASIC_ID_2 52 #define AS3711_NUM_REGS (AS3711_MAX_RE 55 #define AS3711_NUM_REGS (AS3711_MAX_REG + 1) 53 56 54 /* Regulators */ 57 /* Regulators */ 55 enum { 58 enum { 56 AS3711_REGULATOR_SD_1, 59 AS3711_REGULATOR_SD_1, 57 AS3711_REGULATOR_SD_2, 60 AS3711_REGULATOR_SD_2, 58 AS3711_REGULATOR_SD_3, 61 AS3711_REGULATOR_SD_3, 59 AS3711_REGULATOR_SD_4, 62 AS3711_REGULATOR_SD_4, 60 AS3711_REGULATOR_LDO_1, 63 AS3711_REGULATOR_LDO_1, 61 AS3711_REGULATOR_LDO_2, 64 AS3711_REGULATOR_LDO_2, 62 AS3711_REGULATOR_LDO_3, 65 AS3711_REGULATOR_LDO_3, 63 AS3711_REGULATOR_LDO_4, 66 AS3711_REGULATOR_LDO_4, 64 AS3711_REGULATOR_LDO_5, 67 AS3711_REGULATOR_LDO_5, 65 AS3711_REGULATOR_LDO_6, 68 AS3711_REGULATOR_LDO_6, 66 AS3711_REGULATOR_LDO_7, 69 AS3711_REGULATOR_LDO_7, 67 AS3711_REGULATOR_LDO_8, 70 AS3711_REGULATOR_LDO_8, 68 71 69 AS3711_REGULATOR_MAX, 72 AS3711_REGULATOR_MAX, 70 }; 73 }; 71 74 72 struct device; 75 struct device; 73 struct regmap; 76 struct regmap; 74 77 75 struct as3711 { 78 struct as3711 { 76 struct device *dev; 79 struct device *dev; 77 struct regmap *regmap; 80 struct regmap *regmap; 78 }; 81 }; 79 82 80 #define AS3711_MAX_STEPDOWN 4 83 #define AS3711_MAX_STEPDOWN 4 81 #define AS3711_MAX_STEPUP 2 84 #define AS3711_MAX_STEPUP 2 82 #define AS3711_MAX_LDO 8 85 #define AS3711_MAX_LDO 8 83 86 84 enum as3711_su2_feedback { 87 enum as3711_su2_feedback { 85 AS3711_SU2_VOLTAGE, 88 AS3711_SU2_VOLTAGE, 86 AS3711_SU2_CURR1, 89 AS3711_SU2_CURR1, 87 AS3711_SU2_CURR2, 90 AS3711_SU2_CURR2, 88 AS3711_SU2_CURR3, 91 AS3711_SU2_CURR3, 89 AS3711_SU2_CURR_AUTO, 92 AS3711_SU2_CURR_AUTO, 90 }; 93 }; 91 94 92 enum as3711_su2_fbprot { 95 enum as3711_su2_fbprot { 93 AS3711_SU2_LX_SD4, 96 AS3711_SU2_LX_SD4, 94 AS3711_SU2_GPIO2, 97 AS3711_SU2_GPIO2, 95 AS3711_SU2_GPIO3, 98 AS3711_SU2_GPIO3, 96 AS3711_SU2_GPIO4, 99 AS3711_SU2_GPIO4, 97 }; 100 }; 98 101 99 /* 102 /* 100 * Platform data 103 * Platform data 101 */ 104 */ 102 105 103 struct as3711_regulator_pdata { 106 struct as3711_regulator_pdata { 104 struct regulator_init_data *init_data[ 107 struct regulator_init_data *init_data[AS3711_REGULATOR_MAX]; 105 }; 108 }; 106 109 107 struct as3711_bl_pdata { 110 struct as3711_bl_pdata { 108 bool su1_fb; 111 bool su1_fb; 109 int su1_max_uA; 112 int su1_max_uA; 110 bool su2_fb; 113 bool su2_fb; 111 int su2_max_uA; 114 int su2_max_uA; 112 enum as3711_su2_feedback su2_feedback; 115 enum as3711_su2_feedback su2_feedback; 113 enum as3711_su2_fbprot su2_fbprot; 116 enum as3711_su2_fbprot su2_fbprot; 114 bool su2_auto_curr1; 117 bool su2_auto_curr1; 115 bool su2_auto_curr2; 118 bool su2_auto_curr2; 116 bool su2_auto_curr3; 119 bool su2_auto_curr3; 117 }; 120 }; 118 121 119 struct as3711_platform_data { 122 struct as3711_platform_data { 120 struct as3711_regulator_pdata regulato 123 struct as3711_regulator_pdata regulator; 121 struct as3711_bl_pdata backlight; 124 struct as3711_bl_pdata backlight; 122 }; 125 }; 123 126 124 #endif 127 #endif 125 128
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.