Aparna Mallavarapu | 31dea15 | 2014-09-24 11:50:36 +0530 | [diff] [blame^] | 1 | /* Copyright (c) 2014, The Linux Foundation. All rights reserved. |
| 2 | * |
| 3 | * Redistribution and use in source and binary forms, with or without |
| 4 | * modification, are permitted provided that the following conditions are |
| 5 | * met: |
| 6 | * * Redistributions of source code must retain the above copyright |
| 7 | * notice, this list of conditions and the following disclaimer. |
| 8 | * * Redistributions in binary form must reproduce the above |
| 9 | * copyright notice, this list of conditions and the following |
| 10 | * disclaimer in the documentation and/or other materials provided |
| 11 | * with the distribution. |
| 12 | * * Neither the name of The Linux Fundation, Inc. nor the names of its |
| 13 | * contributors may be used to endorse or promote products derived |
| 14 | * from this software without specific prior written permission. |
| 15 | * |
| 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED |
| 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT |
| 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS |
| 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
| 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
| 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
| 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN |
| 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | * |
| 28 | */ |
| 29 | |
| 30 | #include <regulator.h> |
| 31 | #include <rpm-smd.h> |
| 32 | |
| 33 | static uint32_t ldo2[][11]= |
| 34 | { |
| 35 | { |
| 36 | LDOA_RES_TYPE, 2, |
| 37 | KEY_SOFTWARE_ENABLE, 4, GENERIC_DISABLE, |
| 38 | KEY_LDO_SOFTWARE_MODE, 4, SW_MODE_LDO_IPEAK, |
| 39 | KEY_MICRO_VOLT, 4, 0, |
| 40 | }, |
| 41 | |
| 42 | { |
| 43 | LDOA_RES_TYPE, 2, |
| 44 | KEY_SOFTWARE_ENABLE, 4, GENERIC_ENABLE, |
| 45 | KEY_LDO_SOFTWARE_MODE, 4, SW_MODE_LDO_IPEAK, |
| 46 | KEY_MICRO_VOLT, 4, 1250000, |
| 47 | }, |
| 48 | }; |
| 49 | |
| 50 | static uint32_t ldo12[][11]= |
| 51 | { |
| 52 | { |
| 53 | LDOA_RES_TYPE, 12, |
| 54 | KEY_SOFTWARE_ENABLE, 4, GENERIC_DISABLE, |
| 55 | KEY_LDO_SOFTWARE_MODE, 4, SW_MODE_LDO_IPEAK, |
| 56 | KEY_MICRO_VOLT, 4, 0, |
| 57 | }, |
| 58 | |
| 59 | { |
| 60 | LDOA_RES_TYPE, 12, |
| 61 | KEY_SOFTWARE_ENABLE, 4, GENERIC_ENABLE, |
| 62 | KEY_LDO_SOFTWARE_MODE, 4, SW_MODE_LDO_IPEAK, |
| 63 | KEY_MICRO_VOLT, 4, 1800000, |
| 64 | }, |
| 65 | }; |
| 66 | |
| 67 | static uint32_t ldo14[][11]= |
| 68 | { |
| 69 | { |
| 70 | LDOA_RES_TYPE, 14, |
| 71 | KEY_SOFTWARE_ENABLE, 4, GENERIC_DISABLE, |
| 72 | KEY_LDO_SOFTWARE_MODE, 4, SW_MODE_LDO_IPEAK, |
| 73 | KEY_MICRO_VOLT, 4, 0, |
| 74 | }, |
| 75 | |
| 76 | { |
| 77 | LDOA_RES_TYPE, 14, |
| 78 | KEY_SOFTWARE_ENABLE, 4, GENERIC_ENABLE, |
| 79 | KEY_LDO_SOFTWARE_MODE, 4, SW_MODE_LDO_IPEAK, |
| 80 | KEY_MICRO_VOLT, 4, 1800000, |
| 81 | }, |
| 82 | }; |
| 83 | |
| 84 | static uint32_t ldo28[][11]= |
| 85 | { |
| 86 | { |
| 87 | LDOA_RES_TYPE, 28, |
| 88 | KEY_SOFTWARE_ENABLE, 4, GENERIC_DISABLE, |
| 89 | KEY_LDO_SOFTWARE_MODE, 4, SW_MODE_LDO_IPEAK, |
| 90 | KEY_MICRO_VOLT, 4, 0, |
| 91 | }, |
| 92 | |
| 93 | { |
| 94 | LDOA_RES_TYPE, 28, |
| 95 | KEY_SOFTWARE_ENABLE, 4, GENERIC_ENABLE, |
| 96 | KEY_LDO_SOFTWARE_MODE, 4, SW_MODE_LDO_IPEAK, |
| 97 | KEY_MICRO_VOLT, 4, 1000000, |
| 98 | }, |
| 99 | |
| 100 | }; |
| 101 | |
| 102 | void regulator_enable() |
| 103 | { |
| 104 | rpm_send_data(&ldo2[GENERIC_ENABLE][0], 36, RPM_REQUEST_TYPE); |
| 105 | |
| 106 | rpm_send_data(&ldo12[GENERIC_ENABLE][0], 36, RPM_REQUEST_TYPE); |
| 107 | |
| 108 | rpm_send_data(&ldo14[GENERIC_ENABLE][0], 36, RPM_REQUEST_TYPE); |
| 109 | |
| 110 | rpm_send_data(&ldo28[GENERIC_ENABLE][0], 36, RPM_REQUEST_TYPE); |
| 111 | } |
| 112 | |
| 113 | void regulator_disable() |
| 114 | { |
| 115 | |
| 116 | } |