linux/drivers/regulator/pcf50633-regulator.c
<<
>>
Prefs
   1/* NXP PCF50633 PMIC Driver
   2 *
   3 * (C) 2006-2008 by Openmoko, Inc.
   4 * Author: Balaji Rao <balajirrao@openmoko.org>
   5 * All rights reserved.
   6 *
   7 * Broken down from monstrous PCF50633 driver mainly by
   8 * Harald Welte and Andy Green and Werner Almesberger
   9 *
  10 *  This program is free software; you can redistribute  it and/or modify it
  11 *  under  the terms of  the GNU General  Public License as published by the
  12 *  Free Software Foundation;  either version 2 of the  License, or (at your
  13 *  option) any later version.
  14 *
  15 */
  16
  17#include <linux/kernel.h>
  18#include <linux/module.h>
  19#include <linux/init.h>
  20#include <linux/device.h>
  21#include <linux/err.h>
  22#include <linux/platform_device.h>
  23
  24#include <linux/mfd/pcf50633/core.h>
  25#include <linux/mfd/pcf50633/pmic.h>
  26
  27#define PCF50633_REGULATOR(_name, _id, _n)                      \
  28        {                                                       \
  29                .name = _name,                                  \
  30                .id = PCF50633_REGULATOR_##_id,                 \
  31                .ops = &pcf50633_regulator_ops,                 \
  32                .n_voltages = _n,                               \
  33                .type = REGULATOR_VOLTAGE,                      \
  34                .owner = THIS_MODULE,                              8PCF50633_REGULATOR(id = 
  v2.6.19.1
  
  
  v2.6.20de="L28">.ufUT,/a>PCF50633_REGULATOR(PCF50633_REGULATOR(_name, 
  
  
  v2.6.20de="L28">.ufUT + 1,class=ssR" class="sref">PCF50633_REGULATOR(  31                . ssR" class="sref">PCF50633_REGULATOR(PCF50633_REGULATOR(pcf50633_reg4lator4L2">   2  17#4s="sref"4_n,                4     4     arch(tor.c#L31" id="L3u8e="L31">  31  17#4lass="sr4f">REGULATOR_VOLTAGE  17#4/regulatoor/pcf50633-regulator.c#     4              17#4odd" cla4s="sref">id =   27#4efine   17#4me" clas4="sref">_name,   27#40633-reg4lator.c#L29" id="L29" c4ass="48 class="sref">PCF50633_REGULATOR(  27#5ss="sref5>PCF50633_REGULATOR_PCF50633_REGULATOR(pcf50633_reg5lator5ops,       
27#5s="sref"5_n, 5 5 }alajirrao@openmoko.org> REGULATOR_VOLTAGElinux/mfd/pcf50633/core.h<5/regulat5or/pcf50633-regulator.c5 54 arch(tor.c#L31" id="L3u8e="L31"> 31 17#5c#L6" id=="L6" class="line" name=f="+c55 {.c#L17" id="L17" class="line" name="L17"> 17#5efine 17#5me" clas5="sref">_name, 27#50633-reg5lator.c#L29" id="L29" c5ass="58e=PCF50633_Relse 17#5_name 27#6ss="sref6>PCF50633_REGULATOR_PCF50633_REGULATOR(pcf50633_reg6lator61 \ 27#6s="sref"6_n, 6 62 class="sref">PCF50633_REGULATOR(REGULATOR_VOLTAGE,
27#6/regulat6or/pcf50633-regulator.c6 64 }alajirrao@openmoko.org> PCF50633_REGULATOR( 7 31 17#6me" clas6="sref">_name, 17#60633-reg6lator.c#L29" id="L29" c6ass="68 17#6_name 27#7ss="sref7>PCF50633_REGULATOR_ 17#7r_ops" c7ass="sref">pcf50633_reg7lator7ops, 27#7s="sref"7_n, 7 72 class="sref">PCF50633_REGULATOR(REGULATOR_VOLTAGE 27#7/regulat7or/pcf50633-regulator.c7 74ps, 27#7c#L6" id7="L6" class="line" name7f="+c75 }alajirrao@openmoko.org> 7PCF50633_REGULATOR( 17#70633-reg7lator.c#L29" id="L29" c7ass="78 arch(tounsigned intFr.c#L31" id="L3autoid="L33"_ 31 17#7_name 17#8ss="sref8>PCF50633_REGULATOR_pcf50633_reg8lator850633-regulator.c#L12" id="LLLLLLLLL* R , 8 850633-regulator.c#L13" id="LLLLLLLLL* can't be us=" r.c"arc gystem-regulator.c#L17" id="L17" class="line" name="L17"> 17#8lass="sr8f">REGULATOR_VOLTAGE 17#8/regulat8or/pcf50633-regulator.c8 8 27#8c#L6" id8="L6" class="line" name8f="+c85 class="sref">PCF50633_REGULATOR( 7, 27#8rs/regul8ator/pcf50633-regulator8ef="+87 }alajirrao@openmoko.org> PCF50633_REGULATOR(PCF50633_REGULATOR(PCF50633_REGULATOR_ 31 17#9r_ops" c9ass="sref">pcf50633_reg9lator91 {.c#L17" id="L17" class="line" name="L17"> 17#9s="sref"9_n, 9 92ps, 27#9lass="sr9f">REGULATOR_VOLTAGE PCF50633_REGULATOR(PCF50633_REGULATOR( 7 31 17#9rs/regul9ator/pcf50633-regulator9ef="+97 {.c#L17" id="L17" class="line" name="L17"> 17#9/regulat9or/pcf50633-regulator.c9ass="98 < \ 27#9="line" nname="L10"> 10PCF50633_REGULATOR(, 27#101 < 0PCF50633_REGULATOR( 32 . 32 . 32 dev ,ss="sref">PCF50633_REGULATOR( 15 17#10ass="line0" name="L16"> 16 17#10nclude &l0t; 32 .*r.c#L31" id="L3 "L32"> 32 r.c#L27" id="L27" class="line" name="L27"> 27#10s/regulat0or/pcf50633-regulator.c#07#_ito7e=PCF50633_RintFr.c#L31" id="L3 . 27#10s/regulat0or/pcf50633-regulator.c#08#_ito8 < \ 31 27#10gulator/p0cf50633-regulator.c#L20"09#_ito9 class="sref">PCF50633_REGULATOR( 32 ator.c#L31" id="L3 dev_get_drvdata"L32"> 32 dev_get_drvdata \ 32 dev )r.c#L27" id="L27" class="line" name="L27"> 27#1he < 27#1hr 32 dev )r.c#L27" id="L27" class="line" name="L27"> 27#1hegulator..c#L14" id="L14" class="lline"113 17#1ass="line"" name="L15"> 15 27#1lass="linee" name="L16"> 16 PCF50633_REGULATOR( 27#1rs/regulattor/pcf50633-regulator.c##L18"1id="L1.c#L27" id="L27" class="line" name="L27"> 27#1rs/regulattor/pcf50633-regulator.c##L19"118 17#1egulator/ppcf50633-regulator.c#L20"" id=11 \ _id, tor/pcf50633-regulator.c1#L21"12 \ 27#1ulator/pc1f50633-regulator.c#L22" 1id="L12ops, breakr.c#L27" id="L27" class="line" name="L27"> 27#1ur <_id, _id, 27#1uass="linea href="drivers/regulato1r/pcf12de=PCF50633_REGULATORbreakr.c#L27" id="L27" class="line" name="L27"> 27#1unclude &l href="+code=PCF50633_RE1GULAT126 \ _id, _name, _id, _id, 32 >, , 1 12 \ _id, 32 >, PCF50633_REGULATOR_##_i1, casass="sref">_id, 32 >, pcf50633_reg1ulato1_ops, casass="sref">_id, 32 >, _id, 32 >, _id, 32 >, , 1 1 27#1codd" cla1ss="sref">id = 27#1cefine _name, 27#1c0633-reg13lator.c#L29" id="L29" c13ass=138e=PCF50633_R}alajirrao@openmoko.org> PCF50633_REGULATOR(PCF50633_REGULATOR_, 27#14r_ops" c14ass="sref">pcf50633_reg14lato141 }alajirrao@openmoko.org> , 14 142 class="sref">PCF50633_REGULATOR(REGULATOR_VOLTAGE 32 . 32 . 32 dev ,ss="sref">PCF50633_REGULATOR( 32 index .c#L17" id="L17" class="line" name="L17"> 17#14odd" cla14s="sref">id = 17#14efine 32 dev )r.c#L27" id="L27" class="line" name="L27"> 27#14me" clas14="sref">_name, 27#140633-reg14lator.c#L29" id="L29" c14ass=148 27#14_namePCF50633_REGULATOR(PCF50633_REGULATOR_, switch \ 17#15r_ops" c15ass="sref">pcf50633_reg15lato15ops, casass="sref">_id, , 15 15 \ 32 index r.c#L27" id="L27" class="line" name="L27"> 27#15lass="sr15f">REGULATOR_VOLTAGE 27#15/regulat15or/pcf50633-regulator.c15 154ps, casass="sref">_id, , casass="sref">_id, 32 index r.c#L27" id="L27" class="line" name="L27"> 27#15me" clas15="sref">_name, 27#150633-reg15lator.c#L29" id="L29" c15ass=15ine" name="L2casass="sref">_id, _id, _id, 32 >, pcf50633_reg16lato16ops, casass="sref">_id, 32 >, , 16 162 \ _id, 32 >, REGULATOR_VOLTAGE_id, 32 >, _id, 32 >, _id, 32 >, 7 32 index r.c#L27" id="L27" class="line" name="L27"> 27#16me" clas16="sref">_name, 27#160633-reg16lator.c#L29" id="L29" c16ass=168 27#17ss="sref17>PCF50633_REGULATOR_ pcf50633_reg17lato1750633.c#L27" id="L27" class="line" name="L27"> 27#17s="sref"17_n, 17 172ps, 27#17lass="sr17f">REGULATOR_VOLTAGE PCF50633_REGULATOR( 32 . 32 . 17#17line" na17me="L7"> 7 32 setid="L33"_seline"ator.c#L31" id="L3 . 32 .PCF50633_REGULATOR( 32 getid="L33"_seline"ator.c#L31" id="L3 . 32 .PCF50633_REGULATOR( 32 listid="L33" ator.c#L31" id="L3 . 32 .PCF50633_REGULATOR( 32 mapid="L33" ator.c#L31" id="L3 . 32 .PCF50633_REGULATOR(PCF50633_REGULATOR_ 32 enableine"ator.c#L31" id="L3 . 32 .PCF50633_REGULATOR(pcf50633_reg18lato181e=PCF50633_R_t; 32 disableine"ator.c#L31" id="L3 . 32 .PCF50633_REGULATOR(, 18 182e=PCF50633_R_t; 32 .PCF50633_REGULATOR(REGULATOR_VOLTAGElinux/module.h> PCF50633_REGULATOR( 32 . 32 . 17#18line" na18me="L7"> 7, [s="sref">_id, "auto"gulator n \ PCF50633_REGULATOR(, [s="sref">_id, "/a><1"gulator n \ PCF50633_REGULATOR(_id, "/a><2"gulator n \ PCF50633_REGULATOR(_id, "ldo1"gulator n \ PCF50633_REGULATOR(PCF50633_REGULATOR_, [s="sref">_id, "ldo2"gulator n \ PCF50633_REGULATOR(pcf50633_reg19lato191ps, [s="sref">_id, 32 >, "ldo3"gulator n \ 32 LDO" , li),ss="sref">PCF50633_REGULATOR(, 19 192ps, [s="sref">_id, 32 >, "ldo4"gulator n \ 32 LDO4 , li),ss="sref">PCF50633_REGULATOR(REGULATOR_VOLTAGE, [s="sref">_id, 32 >, "ldo5"gulator n \ 32 LDO5 , li),ss="sref">PCF50633_REGULATOR(_id, 32 >, "ldo6"gulator n \ 32 LDO6 , li),ss="sref">PCF50633_REGULATOR(_id, 32 >, "hcldo"gulator n \ 32 HCLDO , li),ss="sref">PCF50633_REGULATOR( 7, [s="sref">_id, 32 >, "memldo"gulator n \ 32 MEMLDO , li),ss="sref">PCF50633_REGULATOR(linux/module.h> PCF50633_REGULATOR( 10 32 _ devinit .r.c#L31" id="L3 . 32 . 32 lator/pcf50633 .*r.c#L31" id="L3"dev"L32"> 32 pdev )ss="sref">PCF50633_REGULATOR( 17#2012< 32 . 32 dev r.c#L27" id="L27" class="line" name="L27"> 27#d0r20 32 .*r.c#L31" id="L3 "L32"> 32 r.c#L27" id="L27" class="line" name="L27"> 27#20egulator20c#L14" id="L14" class="203#_i203ps, structFr.c#L31" id="L3 .linux/module.h> 15PCF50633_REGULATOR( 16 <205#_i205ps, L8" class="line" name=/* Already set by core PCF506-regulator.c#L17" id="L17" class="line" name="L17"> 17#20nclude &20t; 32 ator.c#L31" id="L3dev_to_" name=""L32"> 32 dev_to_" name=" \ 32 pdev -cgL2r.c#L31" id="L3dev"L32"> 32 dev _t; 32 parnam r.c#L27" id="L27" class="line" name="L27"> 27#20s/regula20or/pcf50633-regulator.c207#_i20d="L1.c#L27" id="L27" class="line" name="L27"> 27#20s/regula20or/pcf50633-regulator.c208#_i2o8 < \ 32 dev -regulator.c#L32" id="L3dev"L32"> 32 pdev -cgL2r.c#L31" id="L3dev"L32"> 32 dev r.c#L27" id="L27" class="line" name="L27"> 27#209/regula20name="L10"> 10 32 init_data ator.c#L31" id="L3 dev"L32"> 32 pdev -cgL2r.c#L31" id="L3dev"L32"> 32 dev _t; 32 plator/pcfata r.c#L27" id="L27" class="line" name="L27"> 27#2it2 32 d"L27"cfata ator.c#L31" id="L3 "L32"> 32 r.c#L27" id="L27" class="line" name="L27"> 27#2he2< 32 map ator.c#L31" id="L3 "L32"> 32 -cgL2r.c#L31" id="L3regmap"L32"> 32 map r.c#L27" id="L27" class="line" name="L27"> 27#2hr2 PCF50633_REGULATOR( 32 dev ator.c#L31" id="L3 . 32 . 32 pdev -cgL2r.c#L31" id="L3egulator/pcf50633egine"],egulator.c#L32" id="Lconfigulator/pcf509.1config r.c#L27" id="L27" class="line" name="L27"> 27#2ass="line2" name="L15"> 15 32 dev ))ss="sref">PCF50633_REGULATOR( 16 <2a hre21de=PCF50633_REGULATOR 32 dev )r.c#L27" id="L27" class="line" name="L27"> 27#2anclude &2lt;PCF50633_REGULATOR( 32 plator/pcset_drvdata \ 32 pdev n \ 32 dev )r.c#L27" id="L27" class="line" name="L27"> 27#2as/regula2tor/pcf50633-regulator.c2#L19"218 class="sref">PCF50633_REGULATOR( 32 -cgL2r.c#L31" id="L3pdata"L32"> 32 pdata -cgL2r.c#L31" id="L3reg .PCF50633_REGULATOR( 32 -cgL2r.c#L31" id="L3pdata"L32"> 32 pdata -cgL2r.c#L31" id="L3reg . 32 n \ 32 pdev -cgL2r.c#L31" id="L3egulator/pcf50633egine")r.c#L27" id="L27" class="line" name="L27"> 27#2ulator/pc2f50633-regulator.c#L22" 2id="L2250633.c#L27" id="L27" class="line" name="L27"> 27#2ur2< 27#2regulator2lt;PCF50633_REGULATOR( 32 _ devexit .r.c#L31" id="L3 . 32 . 32 lator/pcf50633 .*r.c#L31" id="L3"dev"L32"> 32 pdev )ss="sref">PCF50633_REGULATOR( 17#2rs/regula2s="sref">_name, 32 . 32 dev ator.c#L31" id="L3 lator/pcget_drvdata"L32"> 32 lator/pcget_drvdata \ 32 pdev )r.c#L27" id="L27" class="line" name="L27"> 27#2us/regula2ulator.c#L29" id="L29" c2lass=228 class="sref">PCF50633_REGULATOR( 32 plator/pcset_drvdata \ 32 pdev n \ 27#2ass="sref2">PCF50633_REGULATOR_##_i230 < \ 32 dev )r.c#L27" id="L27" class="line" name="L27"> 27#2alator/pc2lass="sref">pcf50633_reg2ulato2350633.c#L27" id="L27" class="line" name="L27"> 27#2ar2>_n, 2 232ps, 27#2aegulator2cc#L14" id="L14" class="2i/mfd233 }alajirrao@openmoko.org> , 2 234 class="sref">PCF50633_REGULATOR(id = 32 lator/pcfCF506 .r.c#L31" id="L3 . 32 .PCF50633_REGULATOR( 32 d"L27" .= {ss="sref">PCF50633_REGULATOR(_name, , <"L32"> 32 >, < atorregulator.c#s="cng">"(PCF50633_REGULATOR(PCF50633_REGULATOR( 32 rob" ator.c#L31" id="L3 . 32 .PCF50633_REGULATOR(PCF50633_REGULATOR_ 32 remov" ator.c#L31" id="L3_ devexit_p"L32"> 32 _ devexit_p \ 32 .PCF50633_REGULATOR(pcf50633_reg24lato241 }r.c#L27" id="L27" class="line" name="L27"> 27#24s="sref"24_n, 24 242 class="sref">PCF50633_REGULATOR(REGULATOR_VOLTAGE 32 _ init .r.c#L31" id="L3 . 32 .PCF50633_REGULATOR(PCF50633_REGULATOR(id = 32 . 27#24efine _name, 32 subsys initcall \ 32 . 27#24s/regula24lator.c#L29" id="L29" c24ass=248 class="sref">PCF50633_REGULATOR( 32 _ exit .r.c#L31" id="L3 . 32 .PCF50633_REGULATOR(PCF50633_REGULATOR_ 17#25r_ops" c25ass="sref">pcf50633_reg25lato251 \ 32 . 27#25s="sref"25_n, 25 25 }alajirrao@openmoko.org> REGULATOR_VOLTAGE 32 module exit \ 32 . 27#25/regulat25or/pcf50633-regulator.c25 254 class="sref">PCF50633_REGULATOR("Balaji Rao <balajirrao@openmoko.orgcgL2"gulator)r.c#L27" id="L27" class="line" name="L27"> 27#25efine "1" class 27"> 27< PCF506"gulator)r.c#L27" id="L27" class="line" name="L27"> 27#25me" clas25="sref">_name, "GPL"gulator)r.c#L27" id="L27" class="line" name="L27"> 27#25s/regula25lator.c#L29" id="L29" c25ass=25ine" \ " lator/p:" name="L27"> 27<"gulator)r.c#L27" id="L27" class="line" name="L27"> 27#25_name
The original LXR software by thass="sref">http://sourceor/ge.net/projects/lxru>LXR ne" unity nthis experi namal 27" ion by s="sref">mailto:lxr@ ux.no">lxr@ ux.no _
lxr. ux.no kindly hosted by s="sref">http://www.redpill- pro.no">Redpill L pro AS , provider of L uxocassultcng and operch(ass ser0633s since 1995.