1 /* 2 * Copyright (C) ST-Ericsson SA 2010 3 * 4 * License Terms: GNU General Public License v2 5 * 6 * Authors: Sundar Iyer <sundar.iyer@stericsson.com> for ST-Ericsson 7 * Bengt Jonsson <bengt.g.jonsson@stericsson.com> for ST-Ericsson 8 */ 9 10 #ifndef __LINUX_MFD_AB8500_REGULATOR_H 11 #define __LINUX_MFD_AB8500_REGULATOR_H 12 13 /* AB8500 regulators */ 14 enum ab8500_regulator_id { 15 AB8500_LDO_AUX1, 16 AB8500_LDO_AUX2, 17 AB8500_LDO_AUX3, 18 AB8500_LDO_INTCORE, 19 AB8500_LDO_TVOUT, 20 AB8500_LDO_USB, 21 AB8500_LDO_AUDIO, 22 AB8500_LDO_ANAMIC1, 23 AB8500_LDO_ANAMIC2, 24 AB8500_LDO_DMIC, 25 AB8500_LDO_ANA, 26 AB8500_NUM_REGULATORS, 27 }; 28 29 /* AB9450 regulators */ 30 enum ab9540_regulator_id { 31 AB9540_LDO_AUX1, 32 AB9540_LDO_AUX2, 33 AB9540_LDO_AUX3, 34 AB9540_LDO_AUX4, 35 AB9540_LDO_INTCORE, 36 AB9540_LDO_TVOUT, 37 AB9540_LDO_USB, 38 AB9540_LDO_AUDIO, 39 AB9540_LDO_ANAMIC1, 40 AB9540_LDO_ANAMIC2, 41 AB9540_LDO_DMIC, 42 AB9540_LDO_ANA, 43 AB9540_SYSCLKREQ_2, 44 AB9540_SYSCLKREQ_4, 45 AB9540_NUM_REGULATORS, 46 }; 47 48 /* AB8500 and AB9540 register initialization */ 49 struct ab8500_regulator_reg_init { 50 int id; 51 u8 value; 52 }; 53 54 #define INIT_REGULATOR_REGISTER(_id, _value) \ 55 { \ 56 .id = _id, \ 57 .value = _value, \ 58 } 59 60 /* AB8500 registers */ 61 enum ab8500_regulator_reg { 62 AB8500_REGUREQUESTCTRL2, 63 AB8500_REGUREQUESTCTRL3, 64 AB8500_REGUREQUESTCTRL4, 65 AB8500_REGUSYSCLKREQ1HPVALID1, 66 AB8500_REGUSYSCLKREQ1HPVALID2, 67 AB8500_REGUHWHPREQ1VALID1, 68 AB8500_REGUHWHPREQ1VALID2, 69 AB8500_REGUHWHPREQ2VALID1, 70 AB8500_REGUHWHPREQ2VALID2, 71 AB8500_REGUSWHPREQVALID1, 72 AB8500_REGUSWHPREQVALID2, 73 AB8500_REGUSYSCLKREQVALID1, 74 AB8500_REGUSYSCLKREQVALID2, 75 AB8500_REGUMISC1, 76 AB8500_VAUDIOSUPPLY, 77 AB8500_REGUCTRL1VAMIC, 78 AB8500_VPLLVANAREGU, 79 AB8500_VREFDDR, 80 AB8500_EXTSUPPLYREGU, 81 AB8500_VAUX12REGU, 82 AB8500_VRF1VAUX3REGU, 83 AB8500_VAUX1SEL, 84 AB8500_VAUX2SEL, 85 AB8500_VRF1VAUX3SEL, 86 AB8500_REGUCTRL2SPARE, 87 AB8500_REGUCTRLDISCH, 88 AB8500_REGUCTRLDISCH2, 89 AB8500_VSMPS1SEL1, 90 AB8500_NUM_REGULATOR_REGISTERS, 91 }; 92 93 94 /* AB9540 registers */ 95 enum ab9540_regulator_reg { 96 AB9540_REGUREQUESTCTRL1, 97 AB9540_REGUREQUESTCTRL2, 98 AB9540_REGUREQUESTCTRL3, 99 AB9540_REGUREQUESTCTRL4, 100 AB9540_REGUSYSCLKREQ1HPVALID1, 101 AB9540_REGUSYSCLKREQ1HPVALID2, 102 AB9540_REGUHWHPREQ1VALID1, 103 AB9540_REGUHWHPREQ1VALID2, 104 AB9540_REGUHWHPREQ2VALID1, 105 AB9540_REGUHWHPREQ2VALID2, 106 AB9540_REGUSWHPREQVALID1, 107 AB9540_REGUSWHPREQVALID2, 108 AB9540_REGUSYSCLKREQVALID1, 109 AB9540_REGUSYSCLKREQVALID2, 110 AB9540_REGUVAUX4REQVALID, 111 AB9540_REGUMISC1, 112 AB9540_VAUDIOSUPPLY, 113 AB9540_REGUCTRL1VAMIC, 114 AB9540_VSMPS1REGU, 115 AB9540_VSMPS2REGU, 116 AB9540_VSMPS3REGU, /* NOTE! PRCMU register */ 117 AB9540_VPLLVANAREGU, 118 AB9540_EXTSUPPLYREGU, 119 AB9540_VAUX12REGU, 120 AB9540_VRF1VAUX3REGU, 121 AB9540_VSMPS1SEL1, 122 AB9540_VSMPS1SEL2, 123 AB9540_VSMPS1SEL3, 124 AB9540_VSMPS2SEL1, 125 AB9540_VSMPS2SEL2, 126 AB9540_VSMPS2SEL3, 127 AB9540_VSMPS3SEL1, /* NOTE! PRCMU register */ 128 AB9540_VSMPS3SEL2, /* NOTE! PRCMU register */ 129 AB9540_VAUX1SEL, 130 AB9540_VAUX2SEL, 131 AB9540_VRF1VAUX3SEL, 132 AB9540_REGUCTRL2SPARE, 133 AB9540_VAUX4REQCTRL, 134 AB9540_VAUX4REGU, 135 AB9540_VAUX4SEL, 136 AB9540_REGUCTRLDISCH, 137 AB9540_REGUCTRLDISCH2, 138 AB9540_REGUCTRLDISCH3, 139 AB9540_NUM_REGULATOR_REGISTERS, 140 }; 141 142 #endif 143