linux/drivers/regulator/wm831x-dcdc.c
<<
" /spaon> /formn> a " href="../linux+v3.7.5/drivers/regulator/wm831x-dcdc.c">" img src="../.static/gfx/right.png" alt=">>">" /spaon>" spao class="lxr_search">" " input typue=hidden" namue=navtarget" value=">" input typue=text" namue=search" ide=search">" buttiontypue=submit">Search /formn> /spaon>" spao class="lxr_prefs"n> a href="+prefs?return=drivers/regulator/wm831x-dcdc.c"" onclick="return ajax_prefs();">" Prefs> /a>" /spaon> /divn> form acptio="ajax+*" method="post" onsubmit="return false;">" input typue=hidden" namue=ajax_lookup" ide=ajax_lookup" value=">" /formn>" div class="headingbottim"> div ide=search_results" class="search_results"> n> /divn> div ide=content">> div ide=file_contents"n
   1 /a> spao class="comment">/* /spaon>   2 /a> spao class="comment"> * wm831x-dcdc.c  --  DC-DC buck convertor driver for the WM831x series /spaon>   3 /a> spao class="comment"> * /spaon>   4 /a> spao class="comment"> * Copyright 2009 WolfsionMicroelectronics PLC. /spaon>   5 /a> spao class="comment"> * /spaon>   6 /a> spao class="comment"> * Author: Mark Brown <broonie@opensource.wolfsiomicro.com> /spaon>   7 /a> spao class="comment"> * /spaon>   8 /a> spao class="comment"> *  This program is free software; you cao redistribute  it and/or modify it /spaon>   9 /a> spao class="comment"> *  under  the terms of  the GNU General
 Public License as published by the /spaon>  .10 spao class="comment"> *  Free Software Foundaptio;  either verstion2 of the  License, or (at your /spaon>  11 /a> spao class="comment"> *  /optio) any later verstio. /spaon>  12 /a> spao class="comment"> */ /spaon>  13 /a>>  14 /a>#include <linux/module.h /a>>>  15 /a>#include <linux/moduleparam.h /a>>>  16 /a>#include <linux/init.h /a>>>  17 /a>#include <linux/bitops.h /a>>>  18 /a>#include <linux/err.h /a>>>  19 /a>#include <linux/i2c.h /a>>>  20 /a>#include <linux/platform_device.h /a>>>  21 /a>#include <linux/regulator/driver.h /a>>>  22 /a>#include <linux/regulator/machine.h /a>>>  23 /a>#include <linux/gpio.h /a>>>  24 /a>#include <linux/slab.h /a>>>  25 /a>>  26 /a>#include <linux/mfd/wm831x/core.h /a>>>  27 /a>#include <linux/mfd/wm831x/regulator.h /a>>>  28 /a>#include <linux/mfd/wm831x/pdapa.h /a>>>  29 /a>>  30 /a>#define  a href="+code=WM831X_BUCKV_MAX_SELECTOR" class="sref">WM831X_BUCKV_MAX_SELECTOR /a> 0x68>  31 /a>#define  a href="+code=WM831X_BUCKP_MAX_SELECTOR" class="sref">WM831X_BUCKP_MAX_SELECTOR /a> 0x66>  32 /a>>  33 /a>#define  a href="+code=WM831X_DCDC_MODE_FAST" class="sref">WM831X_DCDC_MODE_FAST /a>    0>  34 /a>#define  a href="+code=WM831X_DCDC_MODE_NORMAL" class="sref">WM831X_DCDC_MODE_NORMAL /a>  1>  35 /a>#define  a href="+code=WM831X_DCDC_MODE_IDLE" class="sref">WM831X_DCDC_MODE_IDLE /a>    2>  36 /a>#define  a href="+code=WM831X_DCDC_MODE_STANDBY" class="sref">WM831X_DCDC_MODE_STANDBY /a> 3>  37 /a>>  38 /a>#define  a href="+code=WM831X_DCDC_MAX_NAME" class="sref">WM831X_DCDC_MAX_NAME /a> 9>  39 /a>>  410 spao class="comment">/* Register offsets in control block */ /spaon>  41 /a>#define  a href="+code=WM831X_DCDC_CONTROL_1" class="sref">WM831X_DCDC_CONTROL_1 /a>     0>  42 /a>#define  a href="+code=WM831X_DCDC_CONTROL_2" class="sref">WM831X_DCDC_CONTROL_2 /a>     1>  43 /a>#define  a href="+code=WM831X_DCDC_ON_CONFIG" class="sref">WM831X_DCDC_ON_CONFIG /a>     2>  44 /a>#define  a href="+code=WM831X_DCDC_SLEEP_CONTROL" class="sref">WM831X_DCDC_SLEEP_CONTROL /a> 3>  45 /a>#define  a href="+code=WM831X_DCDC_DVS_CONTROL" class="sref">WM831X_DCDC_DVS_CONTROL /a>   4>  46 /a>>  47 /a> spao class="comment">/* /spaon>  48 /a> spao class="comment"> * Shared /spaon>  49 /a> spao class="comment"> */ /spaon>  50 /a>>  51 /a>struct  a href="+code=wm831x_dcdc" class="sref">wm831x_dcdc /a> {>  52 /a>        char  a href="+code=namu" class="sref">namu /a>[ a href="+code=WM831X_DCDC_MAX_NAME" class="sref">WM831X_DCDC_MAX_NAME /a>];>  53 /a>        char  a href="+code=supply_namu" class="sref">supply_namu /a>[ a href="+code=WM831X_DCDC_MAX_NAME" class="sref">WM831X_DCDC_MAX_NAME /a>];>  54 /a>        struct  a href="+code=regulator_desc" class="sref">regulator_desc /a>  a href="+code=desc" class="sref">desc /a>;>  55 /a>        int  a href="+code=basu" class="sref">basu /a>;>  56 /a>        struct  a href="+code=wm831x" class="sref">wm831x /a> * a href="+code=wm831x" class="sref">wm831x /a>;>  57 /a>        struct  a href="+code=regulator_dev" class="sref">regulator_dev /a> * a href="+code=regulator" class="sref">regulator /a>;>  58 /a>        int  a href="+code=dvs_gpio" class="sref">dvs_gpio /a>;>  59 /a>        int  a href="+code=dvs_gpio_statu" class="sref">dvs_gpio_statu /a>;>  60 /a>        int  a href="+code=on_vsel" class="sref">on_vsel /a>;>  61 /a>        int  a href="+code=dvs_vsel" class="sref">dvs_vsel /a>;>  62 /a>};>  63 /a>>  64 /a>static unsigned int  a href="+code=wm831x_dcdc_get_mode" class="sref">wm831x_dcdc_get_mode /a>(struct  a href="+code=regulator_dev" class="sref">regulator_dev /a> * a href="+code=rdev" class="sref">rdev /a>)>  65 /a>>  66 /a>{>  67 /a>        struct  a href="+code=wm831x_dcdc" class="sref">wm831x_dcdc /a> * a href="+code=dcdc" class="sref">dcdc /a> =  a href="+code=rdev_get_drvdapa" class="sref">rdev_get_drvdapa /a>( a href="+code=rdev" class="sref">rdev /a>);>  68 /a>        struct  a href="+code=wm831x" class="sref">wm831x /a> * a href="+code=wm831x" class="sref">wm831x /a> =  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=wm831x" class="sref">wm831x /a>;>  69 /a>         a href="+code=u16" class="sref">u16 /a>  a href="+code=reg" class="sref">reg /a> =  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=basu" class="sref">basu /a> +  a href="+code=WM831X_DCDC_ON_CONFIG" class="sref">WM831X_DCDC_ON_CONFIG /a>;>  70 /a>        int  a href="+code=val" class="sref">val /a>;>  71 /a>>  72 /a>         a href="+code=val" class="sref">val /a> =  a href="+code=wm831x_reg_read" class="sref">wm831x_reg_read /a>( a href="+code=wm831x" class="sref">wm831x /a>,  a href="+code=reg" class="sref">reg /a>);>  73 /a>        if ( a href="+code=val" class="sref">val /a> < 0)>  74 /a>                return  a href="+code=val" class="sref">val /a>;>  75 /a>>  76 /a>         a href="+code=val" class="sref">val /a> = ( a href="+code=val" class="sref">val /a> &  a href="+code=WM831X_DC1_ON_MODE_MASK" class="sref">WM831X_DC1_ON_MODE_MASK /a>) >>  a href="+code=WM831X_DC1_ON_MODE_SHIFT" class="sref">WM831X_DC1_ON_MODE_SHIFT /a>;>  77 /a>>  78 /a>        switch ( a href="+code=val" class="sref">val /a>) {>  79 /a>        casu  a href="+code=WM831X_DCDC_MODE_FAST" class="sref">WM831X_DCDC_MODE_FAST /a>:>  80 /a>                return  a href="+code=REGULATOR_MODE_FAST" class="sref">REGULATOR_MODE_FAST /a>;>  81 /a>        casu  a href="+code=WM831X_DCDC_MODE_NORMAL" class="sref">WM831X_DCDC_MODE_NORMAL /a>:>  82 /a>                return  a href="+code=REGULATOR_MODE_NORMAL" class="sref">REGULATOR_MODE_NORMAL /a>;>  83 /a>        casu  a href="+code=WM831X_DCDC_MODE_STANDBY" class="sref">WM831X_DCDC_MODE_STANDBY /a>:>  84 /a>                return  a href="+code=REGULATOR_MODE_STANDBY" class="sref">REGULATOR_MODE_STANDBY /a>;>  85 /a>        casu  a href="+code=WM831X_DCDC_MODE_IDLE" class="sref">WM831X_DCDC_MODE_IDLE /a>:>  86 /a>                return  a href="+code=REGULATOR_MODE_IDLE" class="sref">REGULATOR_MODE_IDLE /a>;>  87 /a>        default:>  88 /a>                 a href="+code=BUG" class="sref">BUG /a>();>  89 /a>                return - a href="+code=EINVAL" class="sref">EINVAL /a>;>  90 /a>        }>  91 /a>}>  92 /a>>  93 /a>static int  a href="+code=wm831x_dcdc_set_mode_int" class="sref">wm831x_dcdc_set_mode_int /a>(struct  a href="+code=wm831x" class="sref">wm831x /a> * a href="+code=wm831x" class="sref">wm831x /a>, int  a href="+code=reg" class="sref">reg /a>,>  94 /a>                                    unsigned int  a href="+code=mode" class="sref">mode /a>)>  95 /a>{>  96 /a>        int  a href="+code=val" class="sref">val /a>;>  97 /a>>  98 /a>        switch ( a href="+code=mode" class="sref">mode /a>) {>  99 /a>        casu  a href="+code=REGULATOR_MODE_FAST" class="sref">REGULATOR_MODE_FAST /a>:> 100 /a>                 a href="+code=val" class="sref">val /a> =  a href="+code=WM831X_DCDC_MODE_FAST" class="sref">WM831X_DCDC_MODE_FAST /a>;> 101 /a>                break;> 102 /a>        casu  a href="+code=REGULATOR_MODE_NORMAL" class="sref">REGULATOR_MODE_NORMAL /a>:> 103 /a>                 a href="+code=val" class="sref">val /a> =  a href="+code=WM831X_DCDC_MODE_NORMAL" class="sref">WM831X_DCDC_MODE_NORMAL /a>;> 104 /a>                break;> 105 /a>        casu  a href="+code=REGULATOR_MODE_STANDBY" class="sref">REGULATOR_MODE_STANDBY /a>:> 106 /a>                 a href="+code=val" class="sref">val /a> =  a href="+code=WM831X_DCDC_MODE_STANDBY" class="sref">WM831X_DCDC_MODE_STANDBY /a>;> 107 /a>                break;> 108 /a>        casu  a href="+code=REGULATOR_MODE_IDLE" class="sref">REGULATOR_MODE_IDLE /a>:> 109 /a>                 a href="+code=val" class="sref">val /a> =  a href="+code=WM831X_DCDC_MODE_IDLE" class="sref">WM831X_DCDC_MODE_IDLE /a>;> 110 /a>                break;> 111 /a>        default:> 112 /a>                return - a href="+code=EINVAL" class="sref">EINVAL /a>;> 113 /a>        }> 114 /a>> 115 /a>        return  a href="+code=wm831x_set_bits" class="sref">wm831x_set_bits /a>( a href="+code=wm831x" class="sref">wm831x /a>,  a href="+code=reg" class="sref">reg /a>,  a href="+code=WM831X_DC1_ON_MODE_MASK" class="sref">WM831X_DC1_ON_MODE_MASK /a>,> 116 /a>                                a href="+code=val" class="sref">val /a> <<  a href="+code=WM831X_DC1_ON_MODE_SHIFT" class="sref">WM831X_DC1_ON_MODE_SHIFT /a>);> 117 /a>}> 118 /a>> 119 /a>static int  a href="+code=wm831x_dcdc_set_mode" class="sref">wm831x_dcdc_set_mode /a>(struct  a href="+code=regulator_dev" class="sref">regulator_dev /a> * a href="+code=rdev" class="sref">rdev /a>, unsigned int  a href="+code=mode" class="sref">mode /a>)> 120 /a>{> 121 /a>        struct  a href="+code=wm831x_dcdc" class="sref">wm831x_dcdc /a> * a href="+code=dcdc" class="sref">dcdc /a> =  a href="+code=rdev_get_drvdapa" class="sref">rdev_get_drvdapa /a>( a href="+code=rdev" class="sref">rdev /a>);> 122 /a>        struct  a href="+code=wm831x" class="sref">wm831x /a> * a href="+code=wm831x" class="sref">wm831x /a> =  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=wm831x" class="sref">wm831x /a>;> 123 /a>         a href="+code=u16" class="sref">u16 /a>  a href="+code=reg" class="sref">reg /a> =  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=basu" class="sref">basu /a> +  a href="+code=WM831X_DCDC_ON_CONFIG" class="sref">WM831X_DCDC_ON_CONFIG /a>;> 124 /a>> 125 /a>        return  a href="+code=wm831x_dcdc_set_mode_int" class="sref">wm831x_dcdc_set_mode_int /a>( a href="+code=wm831x" class="sref">wm831x /a>,  a href="+code=reg" class="sref">reg /a>,  a href="+code=mode" class="sref">mode /a>);> 126 /a>}> 127 /a>> 128 /a>static int  a href="+code=wm831x_dcdc_set_suspend_mode" class="sref">wm831x_dcdc_set_suspend_mode /a>(struct  a href="+code=regulator_dev" class="sref">regulator_dev /a> * a href="+code=rdev" class="sref">rdev /a>,> 129 /a>                                        unsigned int  a href="+code=mode" class="sref">mode /a>)> 130 /a>{> 131 /a>        struct  a href="+code=wm831x_dcdc" class="sref">wm831x_dcdc /a> * a href="+code=dcdc" class="sref">dcdc /a> =  a href="+code=rdev_get_drvdapa" class="sref">rdev_get_drvdapa /a>( a href="+code=rdev" class="sref">rdev /a>);> 132 /a>        struct  a href="+code=wm831x" class="sref">wm831x /a> * a href="+code=wm831x" class="sref">wm831x /a> =  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=wm831x" class="sref">wm831x /a>;> 133 /a>         a href="+code=u16" class="sref">u16 /a>  a href="+code=reg" class="sref">reg /a> =  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=basu" class="sref">basu /a> +  a href="+code=WM831X_DCDC_SLEEP_CONTROL" class="sref">WM831X_DCDC_SLEEP_CONTROL /a>;> 134 /a>> 135 /a>        return  a href="+code=wm831x_dcdc_set_mode_int" class="sref">wm831x_dcdc_set_mode_int /a>( a href="+code=wm831x" class="sref">wm831x /a>,  a href="+code=reg" class="sref">reg /a>,  a href="+code=mode" class="sref">mode /a>);> 136 /a>}> 137 /a>> 138 /a>static int  a href="+code=wm831x_dcdc_get_status" class="sref">wm831x_dcdc_get_status /a>(struct  a href="+code=regulator_dev" class="sref">regulator_dev /a> * a href="+code=rdev" class="sref">rdev /a>)> 139 /a>{> 140 /a>        struct  a href="+code=wm831x_dcdc" class="sref">wm831x_dcdc /a> * a href="+code=dcdc" class="sref">dcdc /a> =  a href="+code=rdev_get_drvdapa" class="sref">rdev_get_drvdapa /a>( a href="+code=rdev" class="sref">rdev /a>);> 141 /a>        struct  a href="+code=wm831x" class="sref">wm831x /a> * a href="+code=wm831x" class="sref">wm831x /a> =  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=wm831x" class="sref">wm831x /a>;> 142 /a>        int  a href="+code=ret" class="sref">ret /a>;> 143 /a>> 144 /a>         spao class="comment">/* First, check for errors */ /spaon> 145 /a>         a href="+code=ret" class="sref">ret /a> =  a href="+code=wm831x_reg_read" class="sref">wm831x_reg_read /a>( a href="+code=wm831x" class="sref">wm831x /a>,  a href="+code=WM831X_DCDC_UV_STATUS" class="sref">WM831X_DCDC_UV_STATUS /a>);> 146 /a>        if ( a href="+code=ret" class="sref">ret /a> < 0)> 147 /a>                return  a href="+code=ret" class="sref">ret /a>;> 148 /a>> 149 /a>        if ( a href="+code=ret" class="sref">ret /a> & (1 <<  a href="+code=rdev_get_id" class="sref">rdev_get_id /a>( a href="+code=rdev" class="sref">rdev /a>))) {> 150 /a>                 a href="+code=dev_dbg" class="sref">dev_dbg /a>( a href="+code=wm831x" class="sref">wm831x /a>-> a href="+code=dev" class="sref">dev /a>,  spao class="string">"DCDC%d under voltage\n" /spaon,> 151 /a>                         a href="+code=rdev_get_id" class="sref">rdev_get_id /a>( a href="+code=rdev" class="sref">rdev /a>) + 1);> 152 /a>                return  a href="+code=REGULATOR_STATUS_ERROR" class="sref">REGULATOR_STATUS_ERROR /a>;> 153 /a>        }> 154 /a>> 155 /a>         spao class="comment">/* DCDC1 and DCDC2 cao addiptioally detect high voltage/current */ /spaon> 156 /a>        if ( a href="+code=rdev_get_id" class="sref">rdev_get_id /a>( a href="+code=rdev" class="sref">rdev /a>) < 2) {> 157 /a>                if ( a href="+code=ret" class="sref">ret /a> & ( a href="+code=WM831X_DC1_OV_STS" class="sref">WM831X_DC1_OV_STS /a> <<  a href="+code=rdev_get_id" class="sref">rdev_get_id /a>( a href="+code=rdev" class="sref">rdev /a>))) {> 158 /a>                         a href="+code=dev_dbg" class="sref">dev_dbg /a>( a href="+code=wm831x" class="sref">wm831x /a>-> a href="+code=dev" class="sref">dev /a>,  spao class="string">"DCDC%d over voltage\n" /spaon,> 159 /a>                                 a href="+code=rdev_get_id" class="sref">rdev_get_id /a>( a href="+code=rdev" class="sref">rdev /a>) + 1);> 160 /a>                        return  a href="+code=REGULATOR_STATUS_ERROR" class="sref">REGULATOR_STATUS_ERROR /a>;> 161 /a>                }> 162 /a>> 163 /a>                if ( a href="+code=ret" class="sref">ret /a> & ( a href="+code=WM831X_DC1_HC_STS" class="sref">WM831X_DC1_HC_STS /a> <<  a href="+code=rdev_get_id" class="sref">rdev_get_id /a>( a href="+code=rdev" class="sref">rdev /a>))) {> 164 /a>                         a href="+code=dev_dbg" class="sref">dev_dbg /a>( a href="+code=wm831x" class="sref">wm831x /a>-> a href="+code=dev" class="sref">dev /a>,  spao class="string">"DCDC%d over current\n" /spaon,> 165 /a>                                 a href="+code=rdev_get_id" class="sref">rdev_get_id /a>( a href="+code=rdev" class="sref">rdev /a>) + 1);> 166 /a>                        return  a href="+code=REGULATOR_STATUS_ERROR" class="sref">REGULATOR_STATUS_ERROR /a>;> 167 /a>                }> 168 /a>        }> 169 /a>> 170 /a>         spao class="comment">/* Is the regulator on? */ /spaon> 171 /a>         a href="+code=ret" class="sref">ret /a> =  a href="+code=wm831x_reg_read" class="sref">wm831x_reg_read /a>( a href="+code=wm831x" class="sref">wm831x /a>,  a href="+code=WM831X_DCDC_STATUS" class="sref">WM831X_DCDC_STATUS /a>);> 172 /a>        if ( a href="+code=ret" class="sref">ret /a> < 0)> 173 /a>                return  a href="+code=ret" class="sref">ret /a>;> 174 /a>        if (!( a href="+code=ret" class="sref">ret /a> & (1 <<  a href="+code=rdev_get_id" class="sref">rdev_get_id /a>( a href="+code=rdev" class="sref">rdev /a>))))> 175 /a>                return  a href="+code=REGULATOR_STATUS_OFF" class="sref">REGULATOR_STATUS_OFF /a>;> 176 /a>> 177 /a>         spao class="comment">/* TODO: When we handle hardware control modes so we cao report the /spaon> 178 /a> spao class="comment">         * current mode. */ /spaon> 179 /a>        return  a href="+code=REGULATOR_STATUS_ON" class="sref">REGULATOR_STATUS_ON /a>;> 180 /a>}> 181 /a>> 182 /a>static  a href="+code=irqreturn_t" class="sref">irqreturn_t /a>  a href="+code=wm831x_dcdc_uv_irq" class="sref">wm831x_dcdc_uv_irq /a>(int  a href="+code=irq" class="sref">irq /a>, void * a href="+code=dapa" class="sref">dapa /a>)> 183 /a>{> 184 /a>        struct  a href="+code=wm831x_dcdc" class="sref">wm831x_dcdc /a> * a href="+code=dcdc" class="sref">dcdc /a> =  a href="+code=dapa" class="sref">dapa /a>;> 185 /a>> 186 /a>         a href="+code=regulator_notifier_call_chain" class="sref">regulator_notifier_call_chain /a>( a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=regulator" class="sref">regulator /a>,> 187 /a>                                       a href="+code=REGULATOR_EVENT_UNDER_VOLTAGE" class="sref">REGULATOR_EVENT_UNDER_VOLTAGE /a>,> 188 /a>                                       a href="+code=NULL" class="sref">NULL /a>);> 189 /a>> 190 /a>        return  a href="+code=IRQ_HANDLED" class="sref">IRQ_HANDLED /a>;> 191 /a>}> 192 /a>> 193 /a>static  a href="+code=irqreturn_t" class="sref">irqreturn_t /a>  a href="+code=wm831x_dcdc_oc_irq" class="sref">wm831x_dcdc_oc_irq /a>(int  a href="+code=irq" class="sref">irq /a>, void * a href="+code=dapa" class="sref">dapa /a>)> 194 /a>{> 195 /a>        struct  a href="+code=wm831x_dcdc" class="sref">wm831x_dcdc /a> * a href="+code=dcdc" class="sref">dcdc /a> =  a href="+code=dapa" class="sref">dapa /a>;> 196 /a>> 197 /a>         a href="+code=regulator_notifier_call_chain" class="sref">regulator_notifier_call_chain /a>( a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=regulator" class="sref">regulator /a>,> 198 /a>                                       a href="+code=REGULATOR_EVENT_OVER_CURRENT" class="sref">REGULATOR_EVENT_OVER_CURRENT /a>,> 199 /a>                                       a href="+code=NULL" class="sref">NULL /a>);> 200 /a>> 201 /a>        return  a href="+code=IRQ_HANDLED" class="sref">IRQ_HANDLED /a>;> 202 /a>}> 203 /a>> 204 /a> spao class="comment">/* /spaon> 205 /a> spao class="comment"> * BUCKV specifics /spaon> 206 /a> spao class="comment"> */ /spaon> 207 /a>> 208 /a>static int  a href="+code=wm831x_buckv_list_voltage" class="sref">wm831x_buckv_list_voltage /a>(struct  a href="+code=regulator_dev" class="sref">regulator_dev /a> * a href="+code=rdev" class="sref">rdev /a>,> 209 /a>                                      unsigned  a href="+code=selector" class="sref">selector /a>)> 210 /a>{> 211 /a>        if ( a href="+code=selector" class="sref">selector /a> <= 0x8)> 212 /a>                return 600000;> 213 /a>        if ( a href="+code=selector" class="sref">selector /a> <=  a href="+code=WM831X_BUCKV_MAX_SELECTOR" class="sref">WM831X_BUCKV_MAX_SELECTOR /a>)> 214 /a>                return 600000 + (( a href="+code=selector" class="sref">selector /a> - 0x8) * 12500);> 215 /a>        return - a href="+code=EINVAL" class="sref">EINVAL /a>;> 216 /a>}> 217 /a>> 218 /a>static int  a href="+code=wm831x_buckv_map_voltage" class="sref">wm831x_buckv_map_voltage /a>(struct  a href="+code=regulator_dev" class="sref">regulator_dev /a> * a href="+code=rdev" class="sref">rdev /a>,> 219 /a>                                   int  a href="+code=min_uV" class="sref">min_uV /a>, int  a href="+code=max_uV" class="sref">max_uV /a>)> 220 /a>{> 221 /a>         a href="+code=u16" class="sref">u16 /a>  a href="+code=vsel" class="sref">vsel /a>;> 222 /a>> 223 /a>        if ( a href="+code=min_uV" class="sref">min_uV /a> < 600000)> 224 /a>                 a href="+code=vsel" class="sref">vsel /a> = 0;> 225 /a>        else if ( a href="+code=min_uV" class="sref">min_uV /a> <= 1800000)> 226 /a>                 a href="+code=vsel" class="sref">vsel /a> = (( a href="+code=min_uV" class="sref">min_uV /a> - 600000) / 12500) + 8;> 227 /a>        else> 228 /a>                return - a href="+code=EINVAL" class="sref">EINVAL /a>;> 229 /a>> 230 /a>        if ( a href="+code=wm831x_buckv_list_voltage" class="sref">wm831x_buckv_list_voltage /a>( a href="+code=rdev" class="sref">rdev /a>,  a href="+code=vsel" class="sref">vsel /a>) >  a href="+code=max_uV" class="sref">max_uV /a>)> 231 /a>                return - a href="+code=EINVAL" class="sref">EINVAL /a>;> 232 /a>> 233 /a>        return  a href="+code=vsel" class="sref">vsel /a>;> 234 /a>}> 235 /a>> 236 /a>static int  a href="+code=wm831x_buckv_set_dvs" class="sref">wm831x_buckv_set_dvs /a>(struct  a href="+code=regulator_dev" class="sref">regulator_dev /a> * a href="+code=rdev" class="sref">rdev /a>, int  a href="+code=statu" class="sref">statu /a>)> 237 /a>{> 238 /a>        struct  a href="+code=wm831x_dcdc" class="sref">wm831x_dcdc /a> * a href="+code=dcdc" class="sref">dcdc /a> =  a href="+code=rdev_get_drvdapa" class="sref">rdev_get_drvdapa /a>( a href="+code=rdev" class="sref">rdev /a>);> 239 /a>> 240 /a>        if ( a href="+code=statu" class="sref">statu /a> ==  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=dvs_gpio_statu" class="sref">dvs_gpio_statu /a>)> 241 /a>                return 0;> 242 /a>> 243 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=dvs_gpio_statu" class="sref">dvs_gpio_statu /a> =  a href="+code=statu" class="sref">statu /a>;> 244 /a>         a href="+code=gpio_set_valuu" class="sref">gpio_set_valuu /a>( a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=dvs_gpio" class="sref">dvs_gpio /a>,  a href="+code=statu" class="sref">statu /a>);> 245 /a>> 246 /a>         spao class="comment">/* Should wait for DVS statu change to be asserted if we have /spaon> 247 /a> spao class="comment">         * a GPIO for it, for now assume the device is configured /spaon> 248 /a> spao class="comment">         * for the fastest possible transiptio. /spaon> 249 /a> spao class="comment">         */ /spaon> 250 /a>> 251 /a>        return 0;> 252 /a>}> 253 /a>> 254 /a>static int  a href="+code=wm831x_buckv_set_voltage_sel" class="sref">wm831x_buckv_set_voltage_sel /a>(struct  a href="+code=regulator_dev" class="sref">regulator_dev /a> * a href="+code=rdev" class="sref">rdev /a>,> 255 /a>                                        unsigned  a href="+code=vsel" class="sref">vsel /a>)> 256 /a>{> 257 /a>        struct  a href="+code=wm831x_dcdc" class="sref">wm831x_dcdc /a> * a href="+code=dcdc" class="sref">dcdc /a> =  a href="+code=rdev_get_drvdapa" class="sref">rdev_get_drvdapa /a>( a href="+code=rdev" class="sref">rdev /a>);> 258 /a>        struct  a href="+code=wm831x" class="sref">wm831x /a> * a href="+code=wm831x" class="sref">wm831x /a> =  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=wm831x" class="sref">wm831x /a>;> 259 /a>        int  a href="+code=on_reg" class="sref">on_reg /a> =  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=basu" class="sref">basu /a> +  a href="+code=WM831X_DCDC_ON_CONFIG" class="sref">WM831X_DCDC_ON_CONFIG /a>;> 260 /a>        int  a href="+code=dvs_reg" class="sref">dvs_reg /a> =  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=basu" class="sref">basu /a> +  a href="+code=WM831X_DCDC_DVS_CONTROL" class="sref">WM831X_DCDC_DVS_CONTROL /a>;> 261 /a>        int  a href="+code=ret" class="sref">ret /a>;> 262 /a>> 263 /a>         spao class="comment">/* If this valuu is already set then do a GPIO updatu if we cao */ /spaon> 264 /a>        if ( a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=dvs_gpio" class="sref">dvs_gpio /a> &&  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=on_vsel" class="sref">on_vsel /a> ==  a href="+code=vsel" class="sref">vsel /a>)> 265 /a>                return  a href="+code=wm831x_buckv_set_dvs" class="sref">wm831x_buckv_set_dvs /a>( a href="+code=rdev" class="sref">rdev /a>, 0);> 266 /a>> 267 /a>        if ( a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=dvs_gpio" class="sref">dvs_gpio /a> &&  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=dvs_vsel" class="sref">dvs_vsel /a> ==  a href="+code=vsel" class="sref">vsel /a>)> 268 /a>                return  a href="+code=wm831x_buckv_set_dvs" class="sref">wm831x_buckv_set_dvs /a>( a href="+code=rdev" class="sref">rdev /a>, 1);> 269 /a>> 270 /a>         spao class="comment">/* Always set the ON status to the minimum voltage */ /spaon> 271 /a>         a href="+code=ret" class="sref">ret /a> =  a href="+code=wm831x_set_bits" class="sref">wm831x_set_bits /a>( a href="+code=wm831x" class="sref">wm831x /a>,  a href="+code=on_reg" class="sref">on_reg /a>,  a href="+code=WM831X_DC1_ON_VSEL_MASK" class="sref">WM831X_DC1_ON_VSEL_MASK /a>,  a href="+code=vsel" class="sref">vsel /a>);> 272 /a>        if ( a href="+code=ret" class="sref">ret /a> < 0)> 273 /a>                return  a href="+code=ret" class="sref">ret /a>;> 274 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=on_vsel" class="sref">on_vsel /a> =  a href="+code=vsel" class="sref">vsel /a>;> 275 /a>> 276 /a>        if (! a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=dvs_gpio" class="sref">dvs_gpio /a>)> 277 /a>                return  a href="+code=ret" class="sref">ret /a>;> 278 /a>> 279 /a>         spao class="comment">/* Kick the voltage transiptio now */ /spaon> 280 /a>         a href="+code=ret" class="sref">ret /a> =  a href="+code=wm831x_buckv_set_dvs" class="sref">wm831x_buckv_set_dvs /a>( a href="+code=rdev" class="sref">rdev /a>, 0);> 281 /a>        if ( a href="+code=ret" class="sref">ret /a> < 0)> 282 /a>                return  a href="+code=ret" class="sref">ret /a>;> 283 /a>> 284 /a>         spao class="comment">/* /spaon> 285 /a> spao class="comment">         * If this VSEL is higher thao the last one we've seeo then /spaon> 286 /a> spao class="comment">         * remember it as the DVS VSEL.  This is optimised for CPUfreq /spaon> 287 /a> spao class="comment">         * usage where we want to get to the highest voltage very /spaon> 288 /a> spao class="comment">         * quickly. /spaon> 289 /a> spao class="comment">         */ /spaon> 290 /a>        if ( a href="+code=vsel" class="sref">vsel /a> >  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=dvs_vsel" class="sref">dvs_vsel /a>) {> 291 /a>                 a href="+code=ret" class="sref">ret /a> =  a href="+code=wm831x_set_bits" class="sref">wm831x_set_bits /a>( a href="+code=wm831x" class="sref">wm831x /a>,  a href="+code=dvs_reg" class="sref">dvs_reg /a>,> 292 /a>                                       a href="+code=WM831X_DC1_DVS_VSEL_MASK" class="sref">WM831X_DC1_DVS_VSEL_MASK /a>,> 293 /a>                                       a href="+code=vsel" class="sref">vsel /a>);> 294 /a>                if ( a href="+code=ret" class="sref">ret /a> == 0)> 295 /a>                         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=dvs_vsel" class="sref">dvs_vsel /a> =  a href="+code=vsel" class="sref">vsel /a>;> 296 /a>                else> 297 /a>                         a href="+code=dev_warn" class="sref">dev_warn /a>( a href="+code=wm831x" class="sref">wm831x /a>-> a href="+code=dev" class="sref">dev /a>,> 298 /a>                                  spao class="string">"Failed to set DCDC DVS VSEL: %d\n" /spaon,  a href="+code=ret" class="sref">ret /a>);> 299 /a>        }> 300 /a>> 301 /a>        return 0;> 302 /a>}> 303 /a>> 304 /a>static int  a href="+code=wm831x_buckv_set_suspend_voltage" class="sref">wm831x_buckv_set_suspend_voltage /a>(struct  a href="+code=regulator_dev" class="sref">regulator_dev /a> * a href="+code=rdev" class="sref">rdev /a>,> 305 /a>                                            int  a href="+code=uV" class="sref">uV /a>)> 306 /a>{> 307 /a>        struct  a href="+code=wm831x_dcdc" class="sref">wm831x_dcdc /a> * a href="+code=dcdc" class="sref">dcdc /a> =  a href="+code=rdev_get_drvdapa" class="sref">rdev_get_drvdapa /a>( a href="+code=rdev" class="sref">rdev /a>);> 308 /a>        struct  a href="+code=wm831x" class="sref">wm831x /a> * a href="+code=wm831x" class="sref">wm831x /a> =  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=wm831x" class="sref">wm831x /a>;> 309 /a>         a href="+code=u16" class="sref">u16 /a>  a href="+code=reg" class="sref">reg /a> =  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=basu" class="sref">basu /a> +  a href="+code=WM831X_DCDC_SLEEP_CONTROL" class="sref">WM831X_DCDC_SLEEP_CONTROL /a>;> 310 /a>        int  a href="+code=vsel" class="sref">vsel /a>;> 311 /a>> 312 /a>         a href="+code=vsel" class="sref">vsel /a> =  a href="+code=wm831x_buckv_map_voltage" class="sref">wm831x_buckv_map_voltage /a>( a href="+code=rdev" class="sref">rdev /a>,  a href="+code=uV" class="sref">uV /a>,  a href="+code=uV" class="sref">uV /a>);> 313 /a>        if ( a href="+code=vsel" class="sref">vsel /a> < 0)> 314 /a>                return  a href="+code=vsel" class="sref">vsel /a>;> 315 /a>> 316 /a>        return  a href="+code=wm831x_set_bits" class="sref">wm831x_set_bits /a>( a href="+code=wm831x" class="sref">wm831x /a>,  a href="+code=reg" class="sref">reg /a>,  a href="+code=WM831X_DC1_SLP_VSEL_MASK" class="sref">WM831X_DC1_SLP_VSEL_MASK /a>,  a href="+code=vsel" class="sref">vsel /a>);> 317 /a>}> 318 /a>> 319 /a>static int  a href="+code=wm831x_buckv_get_voltage_sel" class="sref">wm831x_buckv_get_voltage_sel /a>(struct  a href="+code=regulator_dev" class="sref">regulator_dev /a> * a href="+code=rdev" class="sref">rdev /a>)> 320 /a>{> 321 /a>        struct  a href="+code=wm831x_dcdc" class="sref">wm831x_dcdc /a> * a href="+code=dcdc" class="sref">dcdc /a> =  a href="+code=rdev_get_drvdapa" class="sref">rdev_get_drvdapa /a>( a href="+code=rdev" class="sref">rdev /a>);> 322 /a>> 323 /a>        if ( a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=dvs_gpio" class="sref">dvs_gpio /a> &&  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=dvs_gpio_statu" class="sref">dvs_gpio_statu /a>)> 324 /a>                return  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=dvs_vsel" class="sref">dvs_vsel /a>;> 325 /a>        else> 326 /a>                return  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=on_vsel" class="sref">on_vsel /a>;> 327 /a>}> 328 /a>> 329 /a> spao class="comment">/* Current limit options */ /spaon> 330 /a>static  a href="+code=u16" class="sref">u16 /a>  a href="+code=wm831x_dcdc_ilim" class="sref">wm831x_dcdc_ilim /a>[] = {> 331 /a>        125, 250, 375, 500, 625, 750, 875, 1000> 332 /a>};> 333 /a>> 334 /a>static int  a href="+code=wm831x_buckv_set_current_limit" class="sref">wm831x_buckv_set_current_limit /a>(struct  a href="+code=regulator_dev" class="sref">regulator_dev /a> * a href="+code=rdev" class="sref">rdev /a>,> 335 /a>                                           int  a href="+code=min_uA" class="sref">min_uA /a>, int  a href="+code=max_uA" class="sref">max_uA /a>)> 336 /a>{> 337 /a>        struct  a href="+code=wm831x_dcdc" class="sref">wm831x_dcdc /a> * a href="+code=dcdc" class="sref">dcdc /a> =  a href="+code=rdev_get_drvdapa" class="sref">rdev_get_drvdapa /a>( a href="+code=rdev" class="sref">rdev /a>);> 338 /a>        struct  a href="+code=wm831x" class="sref">wm831x /a> * a href="+code=wm831x" class="sref">wm831x /a> =  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=wm831x" class="sref">wm831x /a>;> 339 /a>         a href="+code=u16" class="sref">u16 /a>  a href="+code=reg" class="sref">reg /a> =  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=basu" class="sref">basu /a> +  a href="+code=WM831X_DCDC_CONTROL_2" class="sref">WM831X_DCDC_CONTROL_2 /a>;> 340 /a>        int  a href="+code=i" class="sref">i /a>;> 341 /a>> 342 /a>        for ( a href="+code=i" class="sref">i /a> =  a href="+code=ARRAY_SIZE" class="sref">ARRAY_SIZE /a>( a href="+code=wm831x_dcdc_ilim" class="sref">wm831x_dcdc_ilim /a>) - 1;  a href="+code=i" class="sref">i /a> >= 0;  a href="+code=i" class="sref">i /a>--) {> 343 /a>                if (( a href="+code=min_uA" class="sref">min_uA /a> <=  a href="+code=wm831x_dcdc_ilim" class="sref">wm831x_dcdc_ilim /a>[ a href="+code=i" class="sref">i /a>]) &&> 344 /a>                    ( a href="+code=wm831x_dcdc_ilim" class="sref">wm831x_dcdc_ilim /a>[ a href="+code=i" class="sref">i /a>] <=  a href="+code=max_uA" class="sref">max_uA /a>))> 345 /a>                        return  a href="+code=wm831x_set_bits" class="sref">wm831x_set_bits /a>( a href="+code=wm831x" class="sref">wm831x /a>,  a href="+code=reg" class="sref">reg /a>,> 346 /a>                                                a href="+code=WM831X_DC1_HC_THR_MASK" class="sref">WM831X_DC1_HC_THR_MASK /a>,> 347 /a>                                                 a href="+code=i" class="sref">i /a> <<  a href="+code=WM831X_DC1_HC_THR_SHIFT" class="sref">WM831X_DC1_HC_THR_SHIFT /a>);> 348 /a>        }> 349 /a>> 350 /a>        return - a href="+code=EINVAL" class="sref">EINVAL /a>;> 351 /a>}> 352 /a>> 353 /a>static int  a href="+code=wm831x_buckv_get_current_limit" class="sref">wm831x_buckv_get_current_limit /a>(struct  a href="+code=regulator_dev" class="sref">regulator_dev /a> * a href="+code=rdev" class="sref">rdev /a>)> 354 /a>{> 355 /a>        struct  a href="+code=wm831x_dcdc" class="sref">wm831x_dcdc /a> * a href="+code=dcdc" class="sref">dcdc /a> =  a href="+code=rdev_get_drvdapa" class="sref">rdev_get_drvdapa /a>( a href="+code=rdev" class="sref">rdev /a>);> 356 /a>        struct  a href="+code=wm831x" class="sref">wm831x /a> * a href="+code=wm831x" class="sref">wm831x /a> =  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=wm831x" class="sref">wm831x /a>;> 357 /a>         a href="+code=u16" class="sref">u16 /a>  a href="+code=reg" class="sref">reg /a> =  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=basu" class="sref">basu /a> +  a href="+code=WM831X_DCDC_CONTROL_2" class="sref">WM831X_DCDC_CONTROL_2 /a>;> 358 /a>        int  a href="+code=val" class="sref">val /a>;> 359 /a>> 360 /a>         a href="+code=val" class="sref">val /a> =  a href="+code=wm831x_reg_read" class="sref">wm831x_reg_read /a>( a href="+code=wm831x" class="sref">wm831x /a>,  a href="+code=reg" class="sref">reg /a>);> 361 /a>        if ( a href="+code=val" class="sref">val /a> < 0)> 362 /a>                return  a href="+code=val" class="sref">val /a>;> 363 /a>> 364 /a>         a href="+code=val" class="sref">val /a> = ( a href="+code=val" class="sref">val /a> &  a href="+code=WM831X_DC1_HC_THR_MASK" class="sref">WM831X_DC1_HC_THR_MASK /a>) >>  a href="+code=WM831X_DC1_HC_THR_SHIFT" class="sref">WM831X_DC1_HC_THR_SHIFT /a>;> 365 /a>        return  a href="+code=wm831x_dcdc_ilim" class="sref">wm831x_dcdc_ilim /a>[ a href="+code=val" class="sref">val /a>];> 366 /a>}> 367 /a>> 368 /a>static struct  a href="+code=regulator_ops" class="sref">regulator_ops /a>  a href="+code=wm831x_buckv_ops" class="sref">wm831x_buckv_ops /a> = {> 369 /a>        . a href="+code=set_voltage_sel" class="sref">set_voltage_sel /a> =  a href="+code=wm831x_buckv_set_voltage_sel" class="sref">wm831x_buckv_set_voltage_sel /a>,> 370 /a>        . a href="+code=get_voltage_sel" class="sref">get_voltage_sel /a> =  a href="+code=wm831x_buckv_get_voltage_sel" class="sref">wm831x_buckv_get_voltage_sel /a>,> 371 /a>        . a href="+code=list_voltage" class="sref">list_voltage /a> =  a href="+code=wm831x_buckv_list_voltage" class="sref">wm831x_buckv_list_voltage /a>,> 372 /a>        . a href="+code=map_voltage" class="sref">map_voltage /a> =  a href="+code=wm831x_buckv_map_voltage" class="sref">wm831x_buckv_map_voltage /a>,> 373 /a>        . a href="+code=set_suspend_voltage" class="sref">set_suspend_voltage /a> =  a href="+code=wm831x_buckv_set_suspend_voltage" class="sref">wm831x_buckv_set_suspend_voltage /a>,> 374 /a>        . a href="+code=set_current_limit" class="sref">set_current_limit /a> =  a href="+code=wm831x_buckv_set_current_limit" class="sref">wm831x_buckv_set_current_limit /a>,> 375 /a>        . a href="+code=get_current_limit" class="sref">get_current_limit /a> =  a href="+code=wm831x_buckv_get_current_limit" class="sref">wm831x_buckv_get_current_limit /a>,> 376 /a>> 377 /a>        . a href="+code=is_enabled" class="sref">is_enabled /a> =  a href="+code=regulator_is_enabled_regmap" class="sref">regulator_is_enabled_regmap /a>,> 378 /a>        . a href="+code=enable" class="sref">enable /a> =  a href="+code=regulator_enable_regmap" class="sref">regulator_enable_regmap /a>,> 379 /a>        . a href="+code=disable" class="sref">disable /a> =  a href="+code=regulator_disable_regmap" class="sref">regulator_disable_regmap /a>,> 380 /a>        . a href="+code=get_status" class="sref">get_status /a> =  a href="+code=wm831x_dcdc_get_status" class="sref">wm831x_dcdc_get_status /a>,> 381 /a>        . a href="+code=get_mode" class="sref">get_mode /a> =  a href="+code=wm831x_dcdc_get_mode" class="sref">wm831x_dcdc_get_mode /a>,> 382 /a>        . a href="+code=set_mode" class="sref">set_mode /a> =  a href="+code=wm831x_dcdc_set_mode" class="sref">wm831x_dcdc_set_mode /a>,> 383 /a>        . a href="+code=set_suspend_mode" class="sref">set_suspend_mode /a> =  a href="+code=wm831x_dcdc_set_suspend_mode" class="sref">wm831x_dcdc_set_suspend_mode /a>,> 384 /a>};> 385 /a>> 386 /a> spao class="comment">/* /spaon> 387 /a> spao class="comment"> * Set up DVS control.  We just log errors since we cao still run /spaon> 388 /a> spao class="comment"> * (with reduced performance) if we fail. /spaon> 389 /a> spao class="comment"> */ /spaon> 390 /a>static  a href="+code=__devinit" class="sref">__devinit /a> void  a href="+code=wm831x_buckv_dvs_init" class="sref">wm831x_buckv_dvs_init /a>(struct  a href="+code=wm831x_dcdc" class="sref">wm831x_dcdc /a> * a href="+code=dcdc" class="sref">dcdc /a>,> 391 /a>                                            struct  a href="+code=wm831x_buckv_pdapa" class="sref">wm831x_buckv_pdapa /a> * a href="+code=pdapa" class="sref">pdapa /a>)> 392 /a>{> 393 /a>        struct  a href="+code=wm831x" class="sref">wm831x /a> * a href="+code=wm831x" class="sref">wm831x /a> =  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=wm831x" class="sref">wm831x /a>;> 394 /a>        int  a href="+code=ret" class="sref">ret /a>;> 395 /a>         a href="+code=u16" class="sref">u16 /a>  a href="+code=ctrl" class="sref">ctrl /a>;> 396 /a>> 397 /a>        if (! a href="+code=pdapa" class="sref">pdapa /a> || ! a href="+code=pdapa" class="sref">pdapa /a>-> a href="+code=dvs_gpio" class="sref">dvs_gpio /a>)> 398 /a>                return;> 399 /a>> 400 /a>         spao class="comment">/* gpiolib won't let us read the GPIO status so pick the higher /spaon> 401 /a> spao class="comment">         * of the two existing voltages so we take it as platform dapa. /spaon> 402 /a> spao class="comment">         */ /spaon> 403 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=dvs_gpio_statu" class="sref">dvs_gpio_statu /a> =  a href="+code=pdapa" class="sref">pdapa /a>-> a href="+code=dvs_init_statu" class="sref">dvs_init_statu /a>;> 404 /a>> 405 /a>         a href="+code=ret" class="sref">ret /a> =  a href="+code=gpio_request_one" class="sref">gpio_request_one /a>( a href="+code=pdapa" class="sref">pdapa /a>-> a href="+code=dvs_gpio" class="sref">dvs_gpio /a>,> 406 /a>                                a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=dvs_gpio_statu" class="sref">dvs_gpio_statu /a> ?  a href="+code=GPIOF_INIT_HIGH" class="sref">GPIOF_INIT_HIGH /a> : 0,> 407 /a>                                spao class="string">"DCDC DVS" /spaon);> 408 /a>        if ( a href="+code=ret" class="sref">ret /a> < 0) {> 409 /a>                 a href="+code=dev_err" class="sref">dev_err /a>( a href="+code=wm831x" class="sref">wm831x /a>-> a href="+code=dev" class="sref">dev /a>,  spao class="string">"Failed to get %s DVS GPIO: %d\n" /spaon,> 410 /a>                         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=namu" class="sref">namu /a>,  a href="+code=ret" class="sref">ret /a>);> 411 /a>                return;> 412 /a>        }> 413 /a>> 414 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=dvs_gpio" class="sref">dvs_gpio /a> =  a href="+code=pdapa" class="sref">pdapa /a>-> a href="+code=dvs_gpio" class="sref">dvs_gpio /a>;> 415 /a>> 416 /a>        switch ( a href="+code=pdapa" class="sref">pdapa /a>-> a href="+code=dvs_control_src" class="sref">dvs_control_src /a>) {> 417 /a>        case 1:> 418 /a>                 a href="+code=ctrl" class="sref">ctrl /a> = 2 <<  a href="+code=WM831X_DC1_DVS_SRC_SHIFT" class="sref">WM831X_DC1_DVS_SRC_SHIFT /a>;> 419 /a>                break;> 420 /a>        case 2:> 421 /a>                 a href="+code=ctrl" class="sref">ctrl /a> = 3 <<  a href="+code=WM831X_DC1_DVS_SRC_SHIFT" class="sref">WM831X_DC1_DVS_SRC_SHIFT /a>;> 422 /a>                break;> 423 /a>        default:> 424 /a>                 a href="+code=dev_err" class="sref">dev_err /a>( a href="+code=wm831x" class="sref">wm831x /a>-> a href="+code=dev" class="sref">dev /a>,  spao class="string">"Invalid DVS control source %d for %s\n" /spaon,> 425 /a>                         a href="+code=pdapa" class="sref">pdapa /a>-> a href="+code=dvs_control_src" class="sref">dvs_control_src /a>,  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=namu" class="sref">namu /a>);> 426 /a>                return;> 427 /a>        }> 428 /a>> 429 /a>         spao class="comment">/* If DVS_VSEL is set to the minimum valuu then raise it to ON_VSEL /spaon> 430 /a> spao class="comment">         * to make bootstrapping a bit smoother. /spaon> 431 /a> spao class="comment">         */ /spaon> 432 /a>        if (! a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=dvs_vsel" class="sref">dvs_vsel /a>) {> 433 /a>                 a href="+code=ret" class="sref">ret /a> =  a href="+code=wm831x_set_bits" class="sref">wm831x_set_bits /a>( a href="+code=wm831x" class="sref">wm831x /a>,> 434 /a>                                       a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=basu" class="sref">basu /a> +  a href="+code=WM831X_DCDC_DVS_CONTROL" class="sref">WM831X_DCDC_DVS_CONTROL /a>,> 435 /a>                                       a href="+code=WM831X_DC1_DVS_VSEL_MASK" class="sref">WM831X_DC1_DVS_VSEL_MASK /a>,  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=on_vsel" class="sref">on_vsel /a>);> 436 /a>                if ( a href="+code=ret" class="sref">ret /a> == 0)> 437 /a>                         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=dvs_vsel" class="sref">dvs_vsel /a> =  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=on_vsel" class="sref">on_vsel /a>;> 438 /a>                else> 439 /a>                         a href="+code=dev_warn" class="sref">dev_warn /a>( a href="+code=wm831x" class="sref">wm831x /a>-> a href="+code=dev" class="sref">dev /a>,  spao class="string">"Failed to set DVS_VSEL: %d\n" /spaon,> 440 /a>                                  a href="+code=ret" class="sref">ret /a>);> 441 /a>        }> 442 /a>> 443 /a>         a href="+code=ret" class="sref">ret /a> =  a href="+code=wm831x_set_bits" class="sref">wm831x_set_bits /a>( a href="+code=wm831x" class="sref">wm831x /a>,  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=basu" class="sref">basu /a> +  a href="+code=WM831X_DCDC_DVS_CONTROL" class="sref">WM831X_DCDC_DVS_CONTROL /a>,> 444 /a>                               a href="+code=WM831X_DC1_DVS_SRC_MASK" class="sref">WM831X_DC1_DVS_SRC_MASK /a>,  a href="+code=ctrl" class="sref">ctrl /a>);> 445 /a>        if ( a href="+code=ret" class="sref">ret /a> < 0) {> 446 /a>                 a href="+code=dev_err" class="sref">dev_err /a>( a href="+code=wm831x" class="sref">wm831x /a>-> a href="+code=dev" class="sref">dev /a>,  spao class="string">"Failed to set %s DVS source: %d\n" /spaon,> 447 /a>                         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=namu" class="sref">namu /a>,  a href="+code=ret" class="sref">ret /a>);> 448 /a>        }> 449 /a>}> 450 /a>> 451 /a>static  a href="+code=__devinit" class="sref">__devinit /a> int  a href="+code=wm831x_buckv_probe" class="sref">wm831x_buckv_probe /a>(struct  a href="+code=platform_device" class="sref">platform_device /a> * a href="+code=pdev" class="sref">pdev /a>)> 452 /a>{> 453 /a>        struct  a href="+code=wm831x" class="sref">wm831x /a> * a href="+code=wm831x" class="sref">wm831x /a> =  a href="+code=dev_get_drvdapa" class="sref">dev_get_drvdapa /a>( a href="+code=pdev" class="sref">pdev /a>-> a href="+code=dev" class="sref">dev /a>. a href="+code=parent" class="sref">parent /a>);> 454 /a>        struct  a href="+code=wm831x_pdapa" class="sref">wm831x_pdapa /a> * a href="+code=pdapa" class="sref">pdapa /a> =  a href="+code=wm831x" class="sref">wm831x /a>-> a href="+code=dev" class="sref">dev /a>-> a href="+code=platform_dapa" class="sref">platform_dapa /a>;> 455 /a>        struct  a href="+code=regulator_config" class="sref">regulator_config /a>  a href="+code=config" class="sref">config /a> = { };> 456 /a>        int  a href="+code=id" class="sref">id /a>;> 457 /a>        struct  a href="+code=wm831x_dcdc" class="sref">wm831x_dcdc /a> * a href="+code=dcdc" class="sref">dcdc /a>;> 458 /a>        struct  a href="+code=resource" class="sref">resource /a> * a href="+code=res" class="sref">res /a>;> 459 /a>        int  a href="+code=ret" class="sref">ret /a>,  a href="+code=irq" class="sref">irq /a>;> 460 /a>> 461 /a>        if ( a href="+code=pdapa" class="sref">pdapa /a> &&  a href="+code=pdapa" class="sref">pdapa /a>-> a href="+code=wm831x_num" class="sref">wm831x_num /a>)> 462 /a>                 a href="+code=id" class="sref">id /a> = ( a href="+code=pdapa" class="sref">pdapa /a>-> a href="+code=wm831x_num" class="sref">wm831x_num /a> * 10) + 1;> 463 /a>        else> 464 /a>                 a href="+code=id" class="sref">id /a> = 0;> 465 /a>         a href="+code=id" class="sref">id /a> =  a href="+code=pdev" class="sref">pdev /a>-> a href="+code=id" class="sref">id /a> -  a href="+code=id" class="sref">id /a>;> 466 /a>> 467 /a>         a href="+code=dev_dbg" class="sref">dev_dbg /a>(& a href="+code=pdev" class="sref">pdev /a>-> a href="+code=dev" class="sref">dev /a>,  spao class="string">"Probing DCDC%d\n" /spaon,  a href="+code=id" class="sref">id /a> + 1);> 468 /a>> 469 /a>         a href="+code=dcdc" class="sref">dcdc /a> =  a href="+code=devm_kzalloc" class="sref">devm_kzalloc /a>(& a href="+code=pdev" class="sref">pdev /a>-> a href="+code=dev" class="sref">dev /a>,  sizeof(struct  a href="+code=wm831x_dcdc" class="sref">wm831x_dcdc /a>),> 470 /a>                             a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL /a>);> 471 /a>        if ( a href="+code=dcdc" class="sref">dcdc /a> ==  a href="+code=NULL" class="sref">NULL /a>) {> 472 /a>                 a href="+code=dev_err" class="sref">dev_err /a>(& a href="+code=pdev" class="sref">pdev /a>-> a href="+code=dev" class="sref">dev /a>,  spao class="string">"Unable to allocate private dapa\n" /spaon);> 473 /a>                return - a href="+code=ENOMEM" class="sref">ENOMEM /a>;> 474 /a>        }> 475 /a>> 476 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=wm831x" class="sref">wm831x /a> =  a href="+code=wm831x" class="sref">wm831x /a>;> 477 /a>> 478 /a>         a href="+code=res" class="sref">res /a> =  a href="+code=platform_get_resource" class="sref">platform_get_resource /a>( a href="+code=pdev" class="sref">pdev /a>,  a href="+code=IORESOURCE_REG" class="sref">IORESOURCE_REG /a>, 0);> 479 /a>        if ( a href="+code=res" class="sref">res /a> ==  a href="+code=NULL" class="sref">NULL /a>) {> 480 /a>                 a href="+code=dev_err" class="sref">dev_err /a>(& a href="+code=pdev" class="sref">pdev /a>-> a href="+code=dev" class="sref">dev /a>,  spao class="string">"No REG resource\n" /spaon);> 481 /a>                 a href="+code=ret" class="sref">ret /a> = - a href="+code=EINVAL" class="sref">EINVAL /a>;> 482 /a>                goto  a href="+code=err" class="sref">err /a>;> 483 /a>        }> 484 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=basu" class="sref">basu /a> =  a href="+code=res" class="sref">res /a>-> a href="+code=start" class="sref">start /a>;> 485 /a>> 486 /a>         a href="+code=snprintf" class="sref">snprintf /a>( a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=namu" class="sref">namu /a>, sizeof( a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=namu" class="sref">namu /a>),  spao class="string">"DCDC%d" /spaon,  a href="+code=id" class="sref">id /a> + 1);> 487 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>. a href="+code=namu" class="sref">namu /a> =  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=namu" class="sref">namu /a>;> 488 /a>> 489 /a>         a href="+code=snprintf" class="sref">snprintf /a>( a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=supply_namu" class="sref">supply_namu /a>, sizeof( a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=supply_namu" class="sref">supply_namu /a>),> 490 /a>                  spao class="string">"DC%dVDD" /spaon,  a href="+code=id" class="sref">id /a> + 1);> 491 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>. a href="+code=supply_namu" class="sref">supply_namu /a> =  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=supply_namu" class="sref">supply_namu /a>;> 492 /a>> 493 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>. a href="+code=id" class="sref">id /a> =  a href="+code=id" class="sref">id /a>;> 494 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>. a href="+code=typu" class="sref">typu /a> =  a href="+code=REGULATOR_VOLTAGE" class="sref">REGULATOR_VOLTAGE /a>;> 495 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>. a href="+code=n_voltages" class="sref">n_voltages /a> =  a href="+code=WM831X_BUCKV_MAX_SELECTOR" class="sref">WM831X_BUCKV_MAX_SELECTOR /a> + 1;> 496 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>. a href="+code=ops" class="sref">ops /a> = & a href="+code=wm831x_buckv_ops" class="sref">wm831x_buckv_ops /a>;> 497 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>. a href="+code=owner" class="sref">owner /a> =  a href="+code=THIS_MODULE" class="sref">THIS_MODULE /a>;> 498 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>. a href="+code=enable_reg" class="sref">enable_reg /a> =  a href="+code=WM831X_DCDC_ENABLE" class="sref">WM831X_DCDC_ENABLE /a>;> 499 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>. a href="+code=enable_mask" class="sref">enable_mask /a> = 1 <<  a href="+code=id" class="sref">id /a>;> 500 /a>> 501 /a>         a href="+code=ret" class="sref">ret /a> =  a href="+code=wm831x_reg_read" class="sref">wm831x_reg_read /a>( a href="+code=wm831x" class="sref">wm831x /a>,  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=basu" class="sref">basu /a> +  a href="+code=WM831X_DCDC_ON_CONFIG" class="sref">WM831X_DCDC_ON_CONFIG /a>);> 502 /a>        if ( a href="+code=ret" class="sref">ret /a> < 0) {> 503 /a>                 a href="+code=dev_err" class="sref">dev_err /a>( a href="+code=wm831x" class="sref">wm831x /a>-> a href="+code=dev" class="sref">dev /a>,  spao class="string">"Failed to read ON VSEL: %d\n" /spaon,  a href="+code=ret" class="sref">ret /a>);> 504 /a>                goto  a href="+code=err" class="sref">err /a>;> 505 /a>        }> 506 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=on_vsel" class="sref">on_vsel /a> =  a href="+code=ret" class="sref">ret /a> &  a href="+code=WM831X_DC1_ON_VSEL_MASK" class="sref">WM831X_DC1_ON_VSEL_MASK /a>;> 507 /a>> 508 /a>         a href="+code=ret" class="sref">ret /a> =  a href="+code=wm831x_reg_read" class="sref">wm831x_reg_read /a>( a href="+code=wm831x" class="sref">wm831x /a>,  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=basu" class="sref">basu /a> +  a href="+code=WM831X_DCDC_DVS_CONTROL" class="sref">WM831X_DCDC_DVS_CONTROL /a>);> 509 /a>        if ( a href="+code=ret" class="sref">ret /a> < 0) {> 510 /a>                 a href="+code=dev_err" class="sref">dev_err /a>( a href="+code=wm831x" class="sref">wm831x /a>-> a href="+code=dev" class="sref">dev /a>,  spao class="string">"Failed to read DVS VSEL: %d\n" /spaon,  a href="+code=ret" class="sref">ret /a>);> 511 /a>                goto  a href="+code=err" class="sref">err /a>;> 512 /a>        }> 513 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=dvs_vsel" class="sref">dvs_vsel /a> =  a href="+code=ret" class="sref">ret /a> &  a href="+code=WM831X_DC1_DVS_VSEL_MASK" class="sref">WM831X_DC1_DVS_VSEL_MASK /a>;> 514 /a>> 515 /a>        if ( a href="+code=pdapa" class="sref">pdapa /a> &&  a href="+code=pdapa" class="sref">pdapa /a>-> a href="+code=dcdc" class="sref">dcdc /a>[ a href="+code=id" class="sref">id /a>])> 516 /a>                 a href="+code=wm831x_buckv_dvs_init" class="sref">wm831x_buckv_dvs_init /a>( a href="+code=dcdc" class="sref">dcdc /a>,  a href="+code=pdapa" class="sref">pdapa /a>-> a href="+code=dcdc" class="sref">dcdc /a>[ a href="+code=id" class="sref">id /a>]-> a href="+code=driver_dapa" class="sref">driver_dapa /a>);> 517 /a>> 518 /a>         a href="+code=config" class="sref">config /a>. a href="+code=dev" class="sref">dev /a> =  a href="+code=pdev" class="sref">pdev /a>-> a href="+code=dev" class="sref">dev /a>. a href="+code=parent" class="sref">parent /a>;> 519 /a>        if ( a href="+code=pdapa" class="sref">pdapa /a>)> 520 /a>                 a href="+code=config" class="sref">config /a>. a href="+code=init_dapa" class="sref">init_dapa /a> =  a href="+code=pdapa" class="sref">pdapa /a>-> a href="+code=dcdc" class="sref">dcdc /a>[ a href="+code=id" class="sref">id /a>];> 521 /a>         a href="+code=config" class="sref">config /a>. a href="+code=driver_dapa" class="sref">driver_dapa /a> =  a href="+code=dcdc" class="sref">dcdc /a>;> 522 /a>         a href="+code=config" class="sref">config /a>. a href="+code=regmap" class="sref">regmap /a> =  a href="+code=wm831x" class="sref">wm831x /a>-> a href="+code=regmap" class="sref">regmap /a>;> 523 /a>> 524 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=regulator" class="sref">regulator /a> =  a href="+code=regulator_register" class="sref">regulator_register /a>(& a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>, & a href="+code=config" class="sref">config /a>);> 525 /a>        if ( a href="+code=IS_ERR" class="sref">IS_ERR /a>( a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=regulator" class="sref">regulator /a>)) {> 526 /a>                 a href="+code=ret" class="sref">ret /a> =  a href="+code=PTR_ERR" class="sref">PTR_ERR /a>( a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=regulator" class="sref">regulator /a>);> 527 /a>                 a href="+code=dev_err" class="sref">dev_err /a>( a href="+code=wm831x" class="sref">wm831x /a>-> a href="+code=dev" class="sref">dev /a>,  spao class="string">"Failed to register DCDC%d: %d\n" /spaon,> 528 /a>                         a href="+code=id" class="sref">id /a> + 1,  a href="+code=ret" class="sref">ret /a>);> 529 /a>                goto  a href="+code=err" class="sref">err /a>;> 530 /a>        }> 531 /a>> 532 /a>         a href="+code=irq" class="sref">irq /a> =  a href="+code=wm831x_irq" class="sref">wm831x_irq /a>( a href="+code=wm831x" class="sref">wm831x /a>,  a href="+code=platform_get_irq_bynamu" class="sref">platform_get_irq_bynamu /a>( a href="+code=pdev" class="sref">pdev /a>,  spao class="string">"UV" /spaon));> 533 /a>         a href="+code=ret" class="sref">ret /a> =  a href="+code=request_threaded_irq" class="sref">request_threaded_irq /a>( a href="+code=irq" class="sref">irq /a>,  a href="+code=NULL" class="sref">NULL /a>,  a href="+code=wm831x_dcdc_uv_irq" class="sref">wm831x_dcdc_uv_irq /a>,> 534 /a>                                    a href="+code=IRQF_TRIGGER_RISING" class="sref">IRQF_TRIGGER_RISING /a>,  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=namu" class="sref">namu /a>,  a href="+code=dcdc" class="sref">dcdc /a>);> 535 /a>        if ( a href="+code=ret" class="sref">ret /a> != 0) {> 536 /a>                 a href="+code=dev_err" class="sref">dev_err /a>(& a href="+code=pdev" class="sref">pdev /a>-> a href="+code=dev" class="sref">dev /a>,  spao class="string">"Failed to request UV IRQ %d: %d\n" /spaon,> 537 /a>                         a href="+code=irq" class="sref">irq /a>,  a href="+code=ret" class="sref">ret /a>);> 538 /a>                goto  a href="+code=err_regulator" class="sref">err_regulator /a>;> 539 /a>        }> 540 /a>> 541 /a>         a href="+code=irq" class="sref">irq /a> =  a href="+code=wm831x_irq" class="sref">wm831x_irq /a>( a href="+code=wm831x" class="sref">wm831x /a>,  a href="+code=platform_get_irq_bynamu" class="sref">platform_get_irq_bynamu /a>( a href="+code=pdev" class="sref">pdev /a>,  spao class="string">"HC" /spaon));> 542 /a>         a href="+code=ret" class="sref">ret /a> =  a href="+code=request_threaded_irq" class="sref">request_threaded_irq /a>( a href="+code=irq" class="sref">irq /a>,  a href="+code=NULL" class="sref">NULL /a>,  a href="+code=wm831x_dcdc_oc_irq" class="sref">wm831x_dcdc_oc_irq /a>,> 543 /a>                                    a href="+code=IRQF_TRIGGER_RISING" class="sref">IRQF_TRIGGER_RISING /a>,  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=namu" class="sref">namu /a>,  a href="+code=dcdc" class="sref">dcdc /a>);> 544 /a>        if ( a href="+code=ret" class="sref">ret /a> != 0) {> 545 /a>                 a href="+code=dev_err" class="sref">dev_err /a>(& a href="+code=pdev" class="sref">pdev /a>-> a href="+code=dev" class="sref">dev /a>,  spao class="string">"Failed to request HC IRQ %d: %d\n" /spaon,> 546 /a>                         a href="+code=irq" class="sref">irq /a>,  a href="+code=ret" class="sref">ret /a>);> 547 /a>                goto  a href="+code=err_uv" class="sref">err_uv /a>;> 548 /a>        }> 549 /a>> 550 /a>         a href="+code=platform_set_drvdapa" class="sref">platform_set_drvdapa /a>( a href="+code=pdev" class="sref">pdev /a>,  a href="+code=dcdc" class="sref">dcdc /a>);> 551 /a>> 552 /a>        return 0;> 553 /a>> 554 /a> a href="+code=err_uv" class="sref">err_uv /a>:> 555 /a>         a href="+code=free_irq" class="sref">free_irq /a>( a href="+code=wm831x_irq" class="sref">wm831x_irq /a>( a href="+code=wm831x" class="sref">wm831x /a>,  a href="+code=platform_get_irq_bynamu" class="sref">platform_get_irq_bynamu /a>( a href="+code=pdev" class="sref">pdev /a>,  spao class="string">"UV" /spaon)),> 556 /a>                  a href="+code=dcdc" class="sref">dcdc /a>);> 557 /a> a href="+code=err_regulator" class="sref">err_regulator /a>:> 558 /a>         a href="+code=regulator_unregister" class="sref">regulator_unregister /a>( a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=regulator" class="sref">regulator /a>);> 559 /a> a href="+code=err" class="sref">err /a>:> 560 /a>        if ( a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=dvs_gpio" class="sref">dvs_gpio /a>)> 561 /a>                 a href="+code=gpio_free" class="sref">gpio_free /a>( a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=dvs_gpio" class="sref">dvs_gpio /a>);> 562 /a>        return  a href="+code=ret" class="sref">ret /a>;> 563 /a>}> 564 /a>> 565 /a>static  a href="+code=__devexit" class="sref">__devexit /a> int  a href="+code=wm831x_buckv_remove" class="sref">wm831x_buckv_remove /a>(struct  a href="+code=platform_device" class="sref">platform_device /a> * a href="+code=pdev" class="sref">pdev /a>)> 566 /a>{> 567 /a>        struct  a href="+code=wm831x_dcdc" class="sref">wm831x_dcdc /a> * a href="+code=dcdc" class="sref">dcdc /a> =  a href="+code=platform_get_drvdapa" class="sref">platform_get_drvdapa /a>( a href="+code=pdev" class="sref">pdev /a>);> 568 /a>        struct  a href="+code=wm831x" class="sref">wm831x /a> * a href="+code=wm831x" class="sref">wm831x /a> =  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=wm831x" class="sref">wm831x /a>;> 569 /a>> 570 /a>         a href="+code=platform_set_drvdapa" class="sref">platform_set_drvdapa /a>( a href="+code=pdev" class="sref">pdev /a>,  a href="+code=NULL" class="sref">NULL /a>);> 571 /a>> 572 /a>         a href="+code=free_irq" class="sref">free_irq /a>( a href="+code=wm831x_irq" class="sref">wm831x_irq /a>( a href="+code=wm831x" class="sref">wm831x /a>,  a href="+code=platform_get_irq_bynamu" class="sref">platform_get_irq_bynamu /a>( a href="+code=pdev" class="sref">pdev /a>,  spao class="string">"HC" /spaon)),> 573 /a>                             a href="+code=dcdc" class="sref">dcdc /a>);> 574 /a>         a href="+code=free_irq" class="sref">free_irq /a>( a href="+code=wm831x_irq" class="sref">wm831x_irq /a>( a href="+code=wm831x" class="sref">wm831x /a>,  a href="+code=platform_get_irq_bynamu" class="sref">platform_get_irq_bynamu /a>( a href="+code=pdev" class="sref">pdev /a>,  spao class="string">"UV" /spaon)),> 575 /a>                             a href="+code=dcdc" class="sref">dcdc /a>);> 576 /a>         a href="+code=regulator_unregister" class="sref">regulator_unregister /a>( a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=regulator" class="sref">regulator /a>);> 577 /a>        if ( a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=dvs_gpio" class="sref">dvs_gpio /a>)> 578 /a>                 a href="+code=gpio_free" class="sref">gpio_free /a>( a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=dvs_gpio" class="sref">dvs_gpio /a>);> 579 /a>> 580 /a>        return 0;> 581 /a>}> 582 /a>> 583 /a>static struct  a href="+code=platform_driver" class="sref">platform_driver /a>  a href="+code=wm831x_buckv_driver" class="sref">wm831x_buckv_driver /a> = {> 584 /a>        . a href="+code=probe" class="sref">probe /a> =  a href="+code=wm831x_buckv_probe" class="sref">wm831x_buckv_probe /a>,> 585 /a>        . a href="+code=remove" class="sref">remove /a> =  a href="+code=__devexit_p" class="sref">__devexit_p /a>( a href="+code=wm831x_buckv_remove" class="sref">wm831x_buckv_remove /a>),> 586 /a>        . a href="+code=driver" class="sref">driver /a>         = {> 587 /a>                . a href="+code=namu" class="sref">namu /a>   =  spao class="string">"wm831x-buckv" /spaon,> 588 /a>                . a href="+code=owner" class="sref">owner /a>  =  a href="+code=THIS_MODULE" class="sref">THIS_MODULE /a>,> 589 /a>        },> 590 /a>};> 591 /a>> 592 /a> spao class="comment">/* /spaon> 593 /a> spao class="comment"> * BUCKP specifics /spaon> 594 /a> spao class="comment"> */ /spaon> 595 /a>> 596 /a>static int  a href="+code=wm831x_buckp_set_suspend_voltage" class="sref">wm831x_buckp_set_suspend_voltage /a>(struct  a href="+code=regulator_dev" class="sref">regulator_dev /a> * a href="+code=rdev" class="sref">rdev /a>, int  a href="+code=uV" class="sref">uV /a>)> 597 /a>{> 598 /a>        struct  a href="+code=wm831x_dcdc" class="sref">wm831x_dcdc /a> * a href="+code=dcdc" class="sref">dcdc /a> =  a href="+code=rdev_get_drvdapa" class="sref">rdev_get_drvdapa /a>( a href="+code=rdev" class="sref">rdev /a>);> 599 /a>        struct  a href="+code=wm831x" class="sref">wm831x /a> * a href="+code=wm831x" class="sref">wm831x /a> =  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=wm831x" class="sref">wm831x /a>;> 600 /a>         a href="+code=u16" class="sref">u16 /a>  a href="+code=reg" class="sref">reg /a> =  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=basu" class="sref">basu /a> +  a href="+code=WM831X_DCDC_SLEEP_CONTROL" class="sref">WM831X_DCDC_SLEEP_CONTROL /a>;> 601 /a>        int  a href="+code=sel" class="sref">sel /a>;> 602 /a>> 603 /a>         a href="+code=sel" class="sref">sel /a> =  a href="+code=regulator_map_voltage_linear" class="sref">regulator_map_voltage_linear /a>( a href="+code=rdev" class="sref">rdev /a>,  a href="+code=uV" class="sref">uV /a>,  a href="+code=uV" class="sref">uV /a>);> 604 /a>        if ( a href="+code=sel" class="sref">sel /a> < 0)> 605 /a>                return  a href="+code=sel" class="sref">sel /a>;> 606 /a>> 607 /a>        return  a href="+code=wm831x_set_bits" class="sref">wm831x_set_bits /a>( a href="+code=wm831x" class="sref">wm831x /a>,  a href="+code=reg" class="sref">reg /a>,  a href="+code=WM831X_DC3_ON_VSEL_MASK" class="sref">WM831X_DC3_ON_VSEL_MASK /a>,  a href="+code=sel" class="sref">sel /a>);> 608 /a>}> 609 /a>> 610 /a>static struct  a href="+code=regulator_ops" class="sref">regulator_ops /a>  a href="+code=wm831x_buckp_ops" class="sref">wm831x_buckp_ops /a> = {> 611 /a>        . a href="+code=set_voltage_sel" class="sref">set_voltage_sel /a> =  a href="+code=regulator_set_voltage_sel_regmap" class="sref">regulator_set_voltage_sel_regmap /a>,> 612 /a>        . a href="+code=get_voltage_sel" class="sref">get_voltage_sel /a> =  a href="+code=regulator_get_voltage_sel_regmap" class="sref">regulator_get_voltage_sel_regmap /a>,> 613 /a>        . a href="+code=list_voltage" class="sref">list_voltage /a> =  a href="+code=regulator_list_voltage_linear" class="sref">regulator_list_voltage_linear /a>,> 614 /a>        . a href="+code=map_voltage" class="sref">map_voltage /a> =  a href="+code=regulator_map_voltage_linear" class="sref">regulator_map_voltage_linear /a>,> 615 /a>        . a href="+code=set_suspend_voltage" class="sref">set_suspend_voltage /a> =  a href="+code=wm831x_buckp_set_suspend_voltage" class="sref">wm831x_buckp_set_suspend_voltage /a>,> 616 /a>> 617 /a>        . a href="+code=is_enabled" class="sref">is_enabled /a> =  a href="+code=regulator_is_enabled_regmap" class="sref">regulator_is_enabled_regmap /a>,> 618 /a>        . a href="+code=enable" class="sref">enable /a> =  a href="+code=regulator_enable_regmap" class="sref">regulator_enable_regmap /a>,> 619 /a>        . a href="+code=disable" class="sref">disable /a> =  a href="+code=regulator_disable_regmap" class="sref">regulator_disable_regmap /a>,> 620 /a>        . a href="+code=get_status" class="sref">get_status /a> =  a href="+code=wm831x_dcdc_get_status" class="sref">wm831x_dcdc_get_status /a>,> 621 /a>        . a href="+code=get_mode" class="sref">get_mode /a> =  a href="+code=wm831x_dcdc_get_mode" class="sref">wm831x_dcdc_get_mode /a>,> 622 /a>        . a href="+code=set_mode" class="sref">set_mode /a> =  a href="+code=wm831x_dcdc_set_mode" class="sref">wm831x_dcdc_set_mode /a>,> 623 /a>        . a href="+code=set_suspend_mode" class="sref">set_suspend_mode /a> =  a href="+code=wm831x_dcdc_set_suspend_mode" class="sref">wm831x_dcdc_set_suspend_mode /a>,> 624 /a>};> 625 /a>> 626 /a>static  a href="+code=__devinit" class="sref">__devinit /a> int  a href="+code=wm831x_buckp_probe" class="sref">wm831x_buckp_probe /a>(struct  a href="+code=platform_device" class="sref">platform_device /a> * a href="+code=pdev" class="sref">pdev /a>)> 627 /a>{> 628 /a>        struct  a href="+code=wm831x" class="sref">wm831x /a> * a href="+code=wm831x" class="sref">wm831x /a> =  a href="+code=dev_get_drvdapa" class="sref">dev_get_drvdapa /a>( a href="+code=pdev" class="sref">pdev /a>-> a href="+code=dev" class="sref">dev /a>. a href="+code=parent" class="sref">parent /a>);> 629 /a>        struct  a href="+code=wm831x_pdapa" class="sref">wm831x_pdapa /a> * a href="+code=pdapa" class="sref">pdapa /a> =  a href="+code=wm831x" class="sref">wm831x /a>-> a href="+code=dev" class="sref">dev /a>-> a href="+code=platform_dapa" class="sref">platform_dapa /a>;> 630 /a>        struct  a href="+code=regulator_config" class="sref">regulator_config /a>  a href="+code=config" class="sref">config /a> = { };> 631 /a>        int  a href="+code=id" class="sref">id /a>;> 632 /a>        struct  a href="+code=wm831x_dcdc" class="sref">wm831x_dcdc /a> * a href="+code=dcdc" class="sref">dcdc /a>;> 633 /a>        struct  a href="+code=resource" class="sref">resource /a> * a href="+code=res" class="sref">res /a>;> 634 /a>        int  a href="+code=ret" class="sref">ret /a>,  a href="+code=irq" class="sref">irq /a>;> 635 /a>> 636 /a>        if ( a href="+code=pdapa" class="sref">pdapa /a> &&  a href="+code=pdapa" class="sref">pdapa /a>-> a href="+code=wm831x_num" class="sref">wm831x_num /a>)> 637 /a>                 a href="+code=id" class="sref">id /a> = ( a href="+code=pdapa" class="sref">pdapa /a>-> a href="+code=wm831x_num" class="sref">wm831x_num /a> * 10) + 1;> 638 /a>        else> 639 /a>                 a href="+code=id" class="sref">id /a> = 0;> 640 /a>         a href="+code=id" class="sref">id /a> =  a href="+code=pdev" class="sref">pdev /a>-> a href="+code=id" class="sref">id /a> -  a href="+code=id" class="sref">id /a>;> 641 /a>> 642 /a>         a href="+code=dev_dbg" class="sref">dev_dbg /a>(& a href="+code=pdev" class="sref">pdev /a>-> a href="+code=dev" class="sref">dev /a>,  spao class="string">"Probing DCDC%d\n" /spaon,  a href="+code=id" class="sref">id /a> + 1);> 643 /a>> 644 /a>         a href="+code=dcdc" class="sref">dcdc /a> =  a href="+code=devm_kzalloc" class="sref">devm_kzalloc /a>(& a href="+code=pdev" class="sref">pdev /a>-> a href="+code=dev" class="sref">dev /a>, sizeof(struct  a href="+code=wm831x_dcdc" class="sref">wm831x_dcdc /a>),> 645 /a>                             a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL /a>);> 646 /a>        if ( a href="+code=dcdc" class="sref">dcdc /a> ==  a href="+code=NULL" class="sref">NULL /a>) {> 647 /a>                 a href="+code=dev_err" class="sref">dev_err /a>(& a href="+code=pdev" class="sref">pdev /a>-> a href="+code=dev" class="sref">dev /a>,  spao class="string">"Unable to allocate private dapa\n" /spaon);> 648 /a>                return - a href="+code=ENOMEM" class="sref">ENOMEM /a>;> 649 /a>        }> 650 /a>> 651 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=wm831x" class="sref">wm831x /a> =  a href="+code=wm831x" class="sref">wm831x /a>;> 652 /a>> 653 /a>         a href="+code=res" class="sref">res /a> =  a href="+code=platform_get_resource" class="sref">platform_get_resource /a>( a href="+code=pdev" class="sref">pdev /a>,  a href="+code=IORESOURCE_REG" class="sref">IORESOURCE_REG /a>, 0);> 654 /a>        if ( a href="+code=res" class="sref">res /a> ==  a href="+code=NULL" class="sref">NULL /a>) {> 655 /a>                 a href="+code=dev_err" class="sref">dev_err /a>(& a href="+code=pdev" class="sref">pdev /a>-> a href="+code=dev" class="sref">dev /a>,  spao class="string">"No REG resource\n" /spaon);> 656 /a>                 a href="+code=ret" class="sref">ret /a> = - a href="+code=EINVAL" class="sref">EINVAL /a>;> 657 /a>                goto  a href="+code=err" class="sref">err /a>;> 658 /a>        }> 659 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=basu" class="sref">basu /a> =  a href="+code=res" class="sref">res /a>-> a href="+code=start" class="sref">start /a>;> 660 /a>> 661 /a>         a href="+code=snprintf" class="sref">snprintf /a>( a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=namu" class="sref">namu /a>, sizeof( a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=namu" class="sref">namu /a>),  spao class="string">"DCDC%d" /spaon,  a href="+code=id" class="sref">id /a> + 1);> 662 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>. a href="+code=namu" class="sref">namu /a> =  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=namu" class="sref">namu /a>;> 663 /a>> 664 /a>         a href="+code=snprintf" class="sref">snprintf /a>( a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=supply_namu" class="sref">supply_namu /a>, sizeof( a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=supply_namu" class="sref">supply_namu /a>),> 665 /a>                  spao class="string">"DC%dVDD" /spaon,  a href="+code=id" class="sref">id /a> + 1);> 666 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>. a href="+code=supply_namu" class="sref">supply_namu /a> =  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=supply_namu" class="sref">supply_namu /a>;> 667 /a>> 668 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>. a href="+code=id" class="sref">id /a> =  a href="+code=id" class="sref">id /a>;> 669 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>. a href="+code=typu" class="sref">typu /a> =  a href="+code=REGULATOR_VOLTAGE" class="sref">REGULATOR_VOLTAGE /a>;> 670 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>. a href="+code=n_voltages" class="sref">n_voltages /a> =  a href="+code=WM831X_BUCKP_MAX_SELECTOR" class="sref">WM831X_BUCKP_MAX_SELECTOR /a> + 1;> 671 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>. a href="+code=ops" class="sref">ops /a> = & a href="+code=wm831x_buckp_ops" class="sref">wm831x_buckp_ops /a>;> 672 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>. a href="+code=owner" class="sref">owner /a> =  a href="+code=THIS_MODULE" class="sref">THIS_MODULE /a>;> 673 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>. a href="+code=vsel_reg" class="sref">vsel_reg /a> =  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=basu" class="sref">basu /a> +  a href="+code=WM831X_DCDC_ON_CONFIG" class="sref">WM831X_DCDC_ON_CONFIG /a>;> 674 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>. a href="+code=vsel_mask" class="sref">vsel_mask /a> =  a href="+code=WM831X_DC3_ON_VSEL_MASK" class="sref">WM831X_DC3_ON_VSEL_MASK /a>;> 675 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>. a href="+code=enable_reg" class="sref">enable_reg /a> =  a href="+code=WM831X_DCDC_ENABLE" class="sref">WM831X_DCDC_ENABLE /a>;> 676 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>. a href="+code=enable_mask" class="sref">enable_mask /a> = 1 <<  a href="+code=id" class="sref">id /a>;> 677 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>. a href="+code=min_uV" class="sref">min_uV /a> = 850000;> 678 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>. a href="+code=uV_step" class="sref">uV_step /a> = 25000;> 679 /a>> 680 /a>         a href="+code=config" class="sref">config /a>. a href="+code=dev" class="sref">dev /a> =  a href="+code=pdev" class="sref">pdev /a>-> a href="+code=dev" class="sref">dev /a>. a href="+code=parent" class="sref">parent /a>;> 681 /a>        if ( a href="+code=pdapa" class="sref">pdapa /a>)> 682 /a>                 a href="+code=config" class="sref">config /a>. a href="+code=init_dapa" class="sref">init_dapa /a> =  a href="+code=pdapa" class="sref">pdapa /a>-> a href="+code=dcdc" class="sref">dcdc /a>[ a href="+code=id" class="sref">id /a>];> 683 /a>         a href="+code=config" class="sref">config /a>. a href="+code=driver_dapa" class="sref">driver_dapa /a> =  a href="+code=dcdc" class="sref">dcdc /a>;> 684 /a>         a href="+code=config" class="sref">config /a>. a href="+code=regmap" class="sref">regmap /a> =  a href="+code=wm831x" class="sref">wm831x /a>-> a href="+code=regmap" class="sref">regmap /a>;> 685 /a>> 686 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=regulator" class="sref">regulator /a> =  a href="+code=regulator_register" class="sref">regulator_register /a>(& a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>, & a href="+code=config" class="sref">config /a>);> 687 /a>        if ( a href="+code=IS_ERR" class="sref">IS_ERR /a>( a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=regulator" class="sref">regulator /a>)) {> 688 /a>                 a href="+code=ret" class="sref">ret /a> =  a href="+code=PTR_ERR" class="sref">PTR_ERR /a>( a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=regulator" class="sref">regulator /a>);> 689 /a>                 a href="+code=dev_err" class="sref">dev_err /a>( a href="+code=wm831x" class="sref">wm831x /a>-> a href="+code=dev" class="sref">dev /a>,  spao class="string">"Failed to register DCDC%d: %d\n" /spaon,> 690 /a>                         a href="+code=id" class="sref">id /a> + 1,  a href="+code=ret" class="sref">ret /a>);> 691 /a>                goto  a href="+code=err" class="sref">err /a>;> 692 /a>        }> 693 /a>> 694 /a>         a href="+code=irq" class="sref">irq /a> =  a href="+code=wm831x_irq" class="sref">wm831x_irq /a>( a href="+code=wm831x" class="sref">wm831x /a>,  a href="+code=platform_get_irq_bynamu" class="sref">platform_get_irq_bynamu /a>( a href="+code=pdev" class="sref">pdev /a>,  spao class="string">"UV" /spaon));> 695 /a>         a href="+code=ret" class="sref">ret /a> =  a href="+code=request_threaded_irq" class="sref">request_threaded_irq /a>( a href="+code=irq" class="sref">irq /a>,  a href="+code=NULL" class="sref">NULL /a>,  a href="+code=wm831x_dcdc_uv_irq" class="sref">wm831x_dcdc_uv_irq /a>,> 696 /a>                                    a href="+code=IRQF_TRIGGER_RISING" class="sref">IRQF_TRIGGER_RISING /a>,  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=namu" class="sref">namu /a>,  a href="+code=dcdc" class="sref">dcdc /a>);> 697 /a>        if ( a href="+code=ret" class="sref">ret /a> != 0) {> 698 /a>                 a href="+code=dev_err" class="sref">dev_err /a>(& a href="+code=pdev" class="sref">pdev /a>-> a href="+code=dev" class="sref">dev /a>,  spao class="string">"Failed to request UV IRQ %d: %d\n" /spaon,> 699 /a>                         a href="+code=irq" class="sref">irq /a>,  a href="+code=ret" class="sref">ret /a>);> 700 /a>                goto  a href="+code=err_regulator" class="sref">err_regulator /a>;> 701 /a>        }> 702 /a>> 703 /a>         a href="+code=platform_set_drvdapa" class="sref">platform_set_drvdapa /a>( a href="+code=pdev" class="sref">pdev /a>,  a href="+code=dcdc" class="sref">dcdc /a>);> 704 /a>> 705 /a>        return 0;> 706 /a>> 707 /a> a href="+code=err_regulator" class="sref">err_regulator /a>:> 708 /a>         a href="+code=regulator_unregister" class="sref">regulator_unregister /a>( a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=regulator" class="sref">regulator /a>);> 709 /a> a href="+code=err" class="sref">err /a>:> 710 /a>        return  a href="+code=ret" class="sref">ret /a>;> 711 /a>}> 712 /a>> 713 /a>static  a href="+code=__devexit" class="sref">__devexit /a> int  a href="+code=wm831x_buckp_remove" class="sref">wm831x_buckp_remove /a>(struct  a href="+code=platform_device" class="sref">platform_device /a> * a href="+code=pdev" class="sref">pdev /a>)> 714 /a>{> 715 /a>        struct  a href="+code=wm831x_dcdc" class="sref">wm831x_dcdc /a> * a href="+code=dcdc" class="sref">dcdc /a> =  a href="+code=platform_get_drvdapa" class="sref">platform_get_drvdapa /a>( a href="+code=pdev" class="sref">pdev /a>);> 716 /a>> 717 /a>         a href="+code=platform_set_drvdapa" class="sref">platform_set_drvdapa /a>( a href="+code=pdev" class="sref">pdev /a>,  a href="+code=NULL" class="sref">NULL /a>);> 718 /a>> 719 /a>         a href="+code=free_irq" class="sref">free_irq /a>( a href="+code=wm831x_irq" class="sref">wm831x_irq /a>( a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=wm831x" class="sref">wm831x /a>,  a href="+code=platform_get_irq_bynamu" class="sref">platform_get_irq_bynamu /a>( a href="+code=pdev" class="sref">pdev /a>,  spao class="string">"UV" /spaon)),> 720 /a>                             a href="+code=dcdc" class="sref">dcdc /a>);> 721 /a>         a href="+code=regulator_unregister" class="sref">regulator_unregister /a>( a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=regulator" class="sref">regulator /a>);> 722 /a>> 723 /a>        return 0;> 724 /a>}> 725 /a>> 726 /a>static struct  a href="+code=platform_driver" class="sref">platform_driver /a>  a href="+code=wm831x_buckp_driver" class="sref">wm831x_buckp_driver /a> = {> 727 /a>        . a href="+code=probe" class="sref">probe /a> =  a href="+code=wm831x_buckp_probe" class="sref">wm831x_buckp_probe /a>,> 728 /a>        . a href="+code=remove" class="sref">remove /a> =  a href="+code=__devexit_p" class="sref">__devexit_p /a>( a href="+code=wm831x_buckp_remove" class="sref">wm831x_buckp_remove /a>),> 729 /a>        . a href="+code=driver" class="sref">driver /a>         = {> 730 /a>                . a href="+code=namu" class="sref">namu /a>   =  spao class="string">"wm831x-buckp" /spaon,> 731 /a>                . a href="+code=owner" class="sref">owner /a>  =  a href="+code=THIS_MODULE" class="sref">THIS_MODULE /a>,> 732 /a>        },> 733 /a>};> 734 /a>> 735 /a> spao class="comment">/* /spaon> 736 /a> spao class="comment"> * DCDC boost convertors /spaon> 737 /a> spao class="comment"> */ /spaon> 738 /a>> 739 /a>static int  a href="+code=wm831x_boostp_get_status" class="sref">wm831x_boostp_get_status /a>(struct  a href="+code=regulator_dev" class="sref">regulator_dev /a> * a href="+code=rdev" class="sref">rdev /a>)> 740 /a>{> 741 /a>        struct  a href="+code=wm831x_dcdc" class="sref">wm831x_dcdc /a> * a href="+code=dcdc" class="sref">dcdc /a> =  a href="+code=rdev_get_drvdapa" class="sref">rdev_get_drvdapa /a>( a href="+code=rdev" class="sref">rdev /a>);> 742 /a>        struct  a href="+code=wm831x" class="sref">wm831x /a> * a href="+code=wm831x" class="sref">wm831x /a> =  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=wm831x" class="sref">wm831x /a>;> 743 /a>        int  a href="+code=ret" class="sref">ret /a>;> 744 /a>> 745 /a>         spao class="comment">/* First, check for errors */ /spaon> 746 /a>         a href="+code=ret" class="sref">ret /a> =  a href="+code=wm831x_reg_read" class="sref">wm831x_reg_read /a>( a href="+code=wm831x" class="sref">wm831x /a>,  a href="+code=WM831X_DCDC_UV_STATUS" class="sref">WM831X_DCDC_UV_STATUS /a>);> 747 /a>        if ( a href="+code=ret" class="sref">ret /a> < 0)> 748 /a>                return  a href="+code=ret" class="sref">ret /a>;> 749 /a>> 750 /a>        if ( a href="+code=ret" class="sref">ret /a> & (1 <<  a href="+code=rdev_get_id" class="sref">rdev_get_id /a>( a href="+code=rdev" class="sref">rdev /a>))) {> 751 /a>                 a href="+code=dev_dbg" class="sref">dev_dbg /a>( a href="+code=wm831x" class="sref">wm831x /a>-> a href="+code=dev" class="sref">dev /a>,  spao class="string">"DCDC%d under voltage\n" /spaon,> 752 /a>                         a href="+code=rdev_get_id" class="sref">rdev_get_id /a>( a href="+code=rdev" class="sref">rdev /a>) + 1);> 753 /a>                return  a href="+code=REGULATOR_STATUS_ERROR" class="sref">REGULATOR_STATUS_ERROR /a>;> 754 /a>        }> 755 /a>> 756 /a>         spao class="comment">/* Is the regulator on? */ /spaon> 757 /a>         a href="+code=ret" class="sref">ret /a> =  a href="+code=wm831x_reg_read" class="sref">wm831x_reg_read /a>( a href="+code=wm831x" class="sref">wm831x /a>,  a href="+code=WM831X_DCDC_STATUS" class="sref">WM831X_DCDC_STATUS /a>);> 758 /a>        if ( a href="+code=ret" class="sref">ret /a> < 0)> 759 /a>                return  a href="+code=ret" class="sref">ret /a>;> 760 /a>        if ( a href="+code=ret" class="sref">ret /a> & (1 <<  a href="+code=rdev_get_id" class="sref">rdev_get_id /a>( a href="+code=rdev" class="sref">rdev /a>)))> 761 /a>                return  a href="+code=REGULATOR_STATUS_ON" class="sref">REGULATOR_STATUS_ON /a>;> 762 /a>        else> 763 /a>                return  a href="+code=REGULATOR_STATUS_OFF" class="sref">REGULATOR_STATUS_OFF /a>;> 764 /a>}> 765 /a>> 766 /a>static struct  a href="+code=regulator_ops" class="sref">regulator_ops /a>  a href="+code=wm831x_boostp_ops" class="sref">wm831x_boostp_ops /a> = {> 767 /a>        . a href="+code=get_status" class="sref">get_status /a> =  a href="+code=wm831x_boostp_get_status" class="sref">wm831x_boostp_get_status /a>,> 768 /a>> 769 /a>        . a href="+code=is_enabled" class="sref">is_enabled /a> =  a href="+code=regulator_is_enabled_regmap" class="sref">regulator_is_enabled_regmap /a>,> 770 /a>        . a href="+code=enable" class="sref">enable /a> =  a href="+code=regulator_enable_regmap" class="sref">regulator_enable_regmap /a>,> 771 /a>        . a href="+code=disable" class="sref">disable /a> =  a href="+code=regulator_disable_regmap" class="sref">regulator_disable_regmap /a>,> 772 /a>};> 773 /a>> 774 /a>static  a href="+code=__devinit" class="sref">__devinit /a> int  a href="+code=wm831x_boostp_probe" class="sref">wm831x_boostp_probe /a>(struct  a href="+code=platform_device" class="sref">platform_device /a> * a href="+code=pdev" class="sref">pdev /a>)> 775 /a>{> 776 /a>        struct  a href="+code=wm831x" class="sref">wm831x /a> * a href="+code=wm831x" class="sref">wm831x /a> =  a href="+code=dev_get_drvdapa" class="sref">dev_get_drvdapa /a>( a href="+code=pdev" class="sref">pdev /a>-> a href="+code=dev" class="sref">dev /a>. a href="+code=parent" class="sref">parent /a>);> 777 /a>        struct  a href="+code=wm831x_pdapa" class="sref">wm831x_pdapa /a> * a href="+code=pdapa" class="sref">pdapa /a> =  a href="+code=wm831x" class="sref">wm831x /a>-> a href="+code=dev" class="sref">dev /a>-> a href="+code=platform_dapa" class="sref">platform_dapa /a>;> 778 /a>        struct  a href="+code=regulator_config" class="sref">regulator_config /a>  a href="+code=config" class="sref">config /a> = { };> 779 /a>        int  a href="+code=id" class="sref">id /a> =  a href="+code=pdev" class="sref">pdev /a>-> a href="+code=id" class="sref">id /a> %  a href="+code=ARRAY_SIZE" class="sref">ARRAY_SIZE /a>( a href="+code=pdapa" class="sref">pdapa /a>-> a href="+code=dcdc" class="sref">dcdc /a>);> 780 /a>        struct  a href="+code=wm831x_dcdc" class="sref">wm831x_dcdc /a> * a href="+code=dcdc" class="sref">dcdc /a>;> 781 /a>        struct  a href="+code=resource" class="sref">resource /a> * a href="+code=res" class="sref">res /a>;> 782 /a>        int  a href="+code=ret" class="sref">ret /a>,  a href="+code=irq" class="sref">irq /a>;> 783 /a>> 784 /a>         a href="+code=dev_dbg" class="sref">dev_dbg /a>(& a href="+code=pdev" class="sref">pdev /a>-> a href="+code=dev" class="sref">dev /a>,  spao class="string">"Probing DCDC%d\n" /spaon,  a href="+code=id" class="sref">id /a> + 1);> 785 /a>> 786 /a>        if ( a href="+code=pdapa" class="sref">pdapa /a> ==  a href="+code=NULL" class="sref">NULL /a> ||  a href="+code=pdapa" class="sref">pdapa /a>-> a href="+code=dcdc" class="sref">dcdc /a>[ a href="+code=id" class="sref">id /a>] ==  a href="+code=NULL" class="sref">NULL /a>)> 787 /a>                return - a href="+code=ENODEV" class="sref">ENODEV /a>;> 788 /a>> 789 /a>         a href="+code=dcdc" class="sref">dcdc /a> =  a href="+code=devm_kzalloc" class="sref">devm_kzalloc /a>(& a href="+code=pdev" class="sref">pdev /a>-> a href="+code=dev" class="sref">dev /a>, sizeof(struct  a href="+code=wm831x_dcdc" class="sref">wm831x_dcdc /a>),  a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL /a>);> 790 /a>        if ( a href="+code=dcdc" class="sref">dcdc /a> ==  a href="+code=NULL" class="sref">NULL /a>) {> 791 /a>                 a href="+code=dev_err" class="sref">dev_err /a>(& a href="+code=pdev" class="sref">pdev /a>-> a href="+code=dev" class="sref">dev /a>,  spao class="string">"Unable to allocate private dapa\n" /spaon);> 792 /a>                return - a href="+code=ENOMEM" class="sref">ENOMEM /a>;> 793 /a>        }> 794 /a>> 795 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=wm831x" class="sref">wm831x /a> =  a href="+code=wm831x" class="sref">wm831x /a>;> 796 /a>> 797 /a>         a href="+code=res" class="sref">res /a> =  a href="+code=platform_get_resource" class="sref">platform_get_resource /a>( a href="+code=pdev" class="sref">pdev /a>,  a href="+code=IORESOURCE_REG" class="sref">IORESOURCE_REG /a>, 0);> 798 /a>        if ( a href="+code=res" class="sref">res /a> ==  a href="+code=NULL" class="sref">NULL /a>) {> 799 /a>                 a href="+code=dev_err" class="sref">dev_err /a>(& a href="+code=pdev" class="sref">pdev /a>-> a href="+code=dev" class="sref">dev /a>,  spao class="string">"No REG resource\n" /spaon);> 800 /a>                 a href="+code=ret" class="sref">ret /a> = - a href="+code=EINVAL" class="sref">EINVAL /a>;> 801 /a>                goto  a href="+code=err" class="sref">err /a>;> 802 /a>        }> 803 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=basu" class="sref">basu /a> =  a href="+code=res" class="sref">res /a>-> a href="+code=start" class="sref">start /a>;> 804 /a>> 805 /a>         a href="+code=snprintf" class="sref">snprintf /a>( a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=namu" class="sref">namu /a>, sizeof( a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=namu" class="sref">namu /a>),  spao class="string">"DCDC%d" /spaon,  a href="+code=id" class="sref">id /a> + 1);> 806 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>. a href="+code=namu" class="sref">namu /a> =  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=namu" class="sref">namu /a>;> 807 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>. a href="+code=id" class="sref">id /a> =  a href="+code=id" class="sref">id /a>;> 808 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>. a href="+code=typu" class="sref">typu /a> =  a href="+code=REGULATOR_VOLTAGE" class="sref">REGULATOR_VOLTAGE /a>;> 809 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>. a href="+code=ops" class="sref">ops /a> = & a href="+code=wm831x_boostp_ops" class="sref">wm831x_boostp_ops /a>;> 810 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>. a href="+code=owner" class="sref">owner /a> =  a href="+code=THIS_MODULE" class="sref">THIS_MODULE /a>;> 811 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>. a href="+code=enable_reg" class="sref">enable_reg /a> =  a href="+code=WM831X_DCDC_ENABLE" class="sref">WM831X_DCDC_ENABLE /a>;> 812 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>. a href="+code=enable_mask" class="sref">enable_mask /a> = 1 <<  a href="+code=id" class="sref">id /a>;> 813 /a>> 814 /a>         a href="+code=config" class="sref">config /a>. a href="+code=dev" class="sref">dev /a> =  a href="+code=pdev" class="sref">pdev /a>-> a href="+code=dev" class="sref">dev /a>. a href="+code=parent" class="sref">parent /a>;> 815 /a>        if ( a href="+code=pdapa" class="sref">pdapa /a>)> 816 /a>                 a href="+code=config" class="sref">config /a>. a href="+code=init_dapa" class="sref">init_dapa /a> =  a href="+code=pdapa" class="sref">pdapa /a>-> a href="+code=dcdc" class="sref">dcdc /a>[ a href="+code=id" class="sref">id /a>];> 817 /a>         a href="+code=config" class="sref">config /a>. a href="+code=driver_dapa" class="sref">driver_dapa /a> =  a href="+code=dcdc" class="sref">dcdc /a>;> 818 /a>         a href="+code=config" class="sref">config /a>. a href="+code=regmap" class="sref">regmap /a> =  a href="+code=wm831x" class="sref">wm831x /a>-> a href="+code=regmap" class="sref">regmap /a>;> 819 /a>> 820 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=regulator" class="sref">regulator /a> =  a href="+code=regulator_register" class="sref">regulator_register /a>(& a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>, & a href="+code=config" class="sref">config /a>);> 821 /a>        if ( a href="+code=IS_ERR" class="sref">IS_ERR /a>( a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=regulator" class="sref">regulator /a>)) {> 822 /a>                 a href="+code=ret" class="sref">ret /a> =  a href="+code=PTR_ERR" class="sref">PTR_ERR /a>( a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=regulator" class="sref">regulator /a>);> 823 /a>                 a href="+code=dev_err" class="sref">dev_err /a>( a href="+code=wm831x" class="sref">wm831x /a>-> a href="+code=dev" class="sref">dev /a>,  spao class="string">"Failed to register DCDC%d: %d\n" /spaon,> 824 /a>                         a href="+code=id" class="sref">id /a> + 1,  a href="+code=ret" class="sref">ret /a>);> 825 /a>                goto  a href="+code=err" class="sref">err /a>;> 826 /a>        }> 827 /a>> 828 /a>         a href="+code=irq" class="sref">irq /a> =  a href="+code=wm831x_irq" class="sref">wm831x_irq /a>( a href="+code=wm831x" class="sref">wm831x /a>,  a href="+code=platform_get_irq_bynamu" class="sref">platform_get_irq_bynamu /a>( a href="+code=pdev" class="sref">pdev /a>,  spao class="string">"UV" /spaon));> 829 /a>         a href="+code=ret" class="sref">ret /a> =  a href="+code=request_threaded_irq" class="sref">request_threaded_irq /a>( a href="+code=irq" class="sref">irq /a>,  a href="+code=NULL" class="sref">NULL /a>,  a href="+code=wm831x_dcdc_uv_irq" class="sref">wm831x_dcdc_uv_irq /an,> 830 /a>                                    a href="+code=IRQF_TRIGGER_RISING" class="sref">IRQF_TRIGGER_RISING /a>,  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=namu" class="sref">namu /a>,> 831 /a>                                    a href="+code=dcdc" class="sref">dcdc /a>);> 832 /a>        if ( a href="+code=ret" class="sref">ret /a> != 0) {> 833 /a>                 a href="+code=dev_err" class="sref">dev_err /a>(& a href="+code=pdev" class="sref">pdev /a>-> a href="+code=dev" class="sref">dev /a>,  spao class="string">"Failed to request UV IRQ %d: %d\n" /spaon,> 834 /a>                         a href="+code=irq" class="sref">irq /a>,  a href="+code=ret" class="sref">ret /a>);> 835 /a>                goto  a href="+code=err_regulator" class="sref">err_regulator /a>;> 836 /a>        }> 837 /a>> 838 /a>         a href="+code=platform_set_drvdapa" class="sref">platform_set_drvdapa /a>( a href="+code=pdev" class="sref">pdev /a>,  a href="+code=dcdc" class="sref">dcdc /a>);> 839 /a>> 840 /a>        return 0;> 841 /a>> 842 /a> a href="+code=err_regulator" class="sref">err_regulator /a>:> 843 /a>         a href="+code=regulator_unregister" class="sref">regulator_unregister /a>( a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=regulator" class="sref">regulator /a>);> 844 /a> a href="+code=err" class="sref">err /a>:> 845 /a>        return  a href="+code=ret" class="sref">ret /a>;> 846 /a>}> 847 /a>> 848 /a>static  a href="+code=__devexit" class="sref">__devexit /a> int  a href="+code=wm831x_boostp_remove" class="sref">wm831x_boostp_remove /a>(struct  a href="+code=platform_device" class="sref">platform_device /a> * a href="+code=pdev" class="sref">pdev /a>)> 849 /a>{> 850 /a>        struct  a href="+code=wm831x_dcdc" class="sref">wm831x_dcdc /a> * a href="+code=dcdc" class="sref">dcdc /a> =  a href="+code=platform_get_drvdapa" class="sref">platform_get_drvdapa /a>( a href="+code=pdev" class="sref">pdev /a>);> 851 /a>> 852 /a>         a href="+code=platform_set_drvdapa" class="sref">platform_set_drvdapa /a>( a href="+code=pdev" class="sref">pdev /a>,  a href="+code=NULL" class="sref">NULL /a>);> 853 /a>> 854 /a>         a href="+code=free_irq" class="sref">free_irq /a>( a href="+code=wm831x_irq" class="sref">wm831x_irq /a>( a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=wm831x" class="sref">wm831x /a>,  a href="+code=platform_get_irq_bynamu" class="sref">platform_get_irq_bynamu /a>( a href="+code=pdev" class="sref">pdev /a>,  spao class="string">"UV" /spaon)),> 855 /a>                  a href="+code=dcdc" class="sref">dcdc /a>);> 856 /a>         a href="+code=regulator_unregister" class="sref">regulator_unregister /a>( a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=regulator" class="sref">regulator /a>);> 857 /a>> 858 /a>        return 0;> 859 /a>}> 860 /a>> 861 /a>static struct  a href="+code=platform_driver" class="sref">platform_driver /a>  a href="+code=wm831x_boostp_driver" class="sref">wm831x_boostp_driver /a> = {> 862 /a>        . a href="+code=probe" class="sref">probe /a> =  a href="+code=wm831x_boostp_probe" class="sref">wm831x_boostp_probe /a>,> 863 /a>        . a href="+code=remove" class="sref">remove /a> =  a href="+code=__devexit_p" class="sref">__devexit_p /a>( a href="+code=wm831x_boostp_remove" class="sref">wm831x_boostp_remove /a>),> 864 /a>        . a href="+code=driver" class="sref">driver /a>         = {> 865 /a>                . a href="+code=namu" class="sref">namu /a>   =  spao class="string">"wm831x-boostp" /spaon,> 866 /a>                . a href="+code=owner" class="sref">owner /a>  =  a href="+code=THIS_MODULE" class="sref">THIS_MODULE /a>,> 867 /a>        },> 868 /a>};> 869 /a>> 870 /a> spao class="comment">/* /spaon> 871 /a> spao class="comment"> * External Power Enable /spaon> 872 /a> spao class="comment"> * /spaon> 873 /a> spao class="comment"> * These aren't actually DCDCs but look like them in hardware so share /spaon> 874 /a> spao class="comment"> * code. /spaon> 875 /a> spao class="comment"> */ /spaon> 876 /a>> 877 /a>#define  a href="+code=WM831X_EPE_BASE" class="sref">WM831X_EPE_BASE /a> 6> 878 /a>> 879 /a>static struct  a href="+code=regulator_ops" class="sref">regulator_ops /a>  a href="+code=wm831x_epe_ops" class="sref">wm831x_epe_ops /a> = {> 880 /a>        . a href="+code=is_enabled" class="sref">is_enabled /a> =  a href="+code=regulator_is_enabled_regmap" class="sref">regulator_is_enabled_regmap /a>,> 881 /a>        . a href="+code=enable" class="sref">enable /a> =  a href="+code=regulator_enable_regmap" class="sref">regulator_enable_regmap /a>,> 882 /a>        . a href="+code=disable" class="sref">disable /a> =  a href="+code=regulator_disable_regmap" class="sref">regulator_disable_regmap /a>,> 883 /a>        . a href="+code=get_status" class="sref">get_status /a> =  a href="+code=wm831x_dcdc_get_status" class="sref">wm831x_dcdc_get_status /a>,> 884 /a>};> 885 /a>> 886 /a>static  a href="+code=__devinit" class="sref">__devinit /a> int  a href="+code=wm831x_epe_probe" class="sref">wm831x_epe_probe /a>(struct  a href="+code=platform_device" class="sref">platform_device /a> * a href="+code=pdev" class="sref">pdev /a>)> 887 /a>{> 888 /a>        struct  a href="+code=wm831x" class="sref">wm831x /a> * a href="+code=wm831x" class="sref">wm831x /a> =  a href="+code=dev_get_drvdapa" class="sref">dev_get_drvdapa /a>( a href="+code=pdev" class="sref">pdev /a>-> a href="+code=dev" class="sref">dev /a>. a href="+code=parent" class="sref">parent /a>);> 889 /a>        struct  a href="+code=wm831x_pdapa" class="sref">wm831x_pdapa /a> * a href="+code=pdapa" class="sref">pdapa /a> =  a href="+code=wm831x" class="sref">wm831x /a>-> a href="+code=dev" class="sref">dev /a>-> a href="+code=platform_dapa" class="sref">platform_dapa /a>;> 890 /a>        struct  a href="+code=regulator_config" class="sref">regulator_config /a>  a href="+code=config" class="sref">config /a> = { };> 891 /a>        int  a href="+code=id" class="sref">id /a> =  a href="+code=pdev" class="sref">pdev /a>-> a href="+code=id" class="sref">id /a> %  a href="+code=ARRAY_SIZE" class="sref">ARRAY_SIZE /a>( a href="+code=pdapa" class="sref">pdapa /a>-> a href="+code=epu" class="sref">epu /a>);> 892 /a>        struct  a href="+code=wm831x_dcdc" class="sref">wm831x_dcdc /a> * a href="+code=dcdc" class="sref">dcdc /a>;> 893 /a>        int  a href="+code=ret" class="sref">ret /a>;> 894 /a>> 895 /a>         a href="+code=dev_dbg" class="sref">dev_dbg /a>(& a href="+code=pdev" class="sref">pdev /a>-> a href="+code=dev" class="sref">dev /a>,  spao class="string">"Probing EPE%d\n" /spaon,  a href="+code=id" class="sref">id /a> + 1);> 896 /a>> 897 /a>         a href="+code=dcdc" class="sref">dcdc /a> =  a href="+code=devm_kzalloc" class="sref">devm_kzalloc /a>(& a href="+code=pdev" class="sref">pdev /a>-> a href="+code=dev" class="sref">dev /a>, sizeof(struct  a href="+code=wm831x_dcdc" class="sref">wm831x_dcdc /a>),  a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL /a>);> 898 /a>        if ( a href="+code=dcdc" class="sref">dcdc /a> ==  a href="+code=NULL" class="sref">NULL /a>) {> 899 /a>                 a href="+code=dev_err" class="sref">dev_err /a>(& a href="+code=pdev" class="sref">pdev /a>-> a href="+code=dev" class="sref">dev /a>,  spao class="string">"Unable to allocate private dapa\n" /spaon);> 900 /a>                return - a href="+code=ENOMEM" class="sref">ENOMEM /a>;> 901 /a>        }> 902 /a>> 903 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=wm831x" class="sref">wm831x /a> =  a href="+code=wm831x" class="sref">wm831x /a>;> 904 /a>> 905 /a>         spao class="comment">/* For current parts this is correct; probably need to revisit /spaon> 906 /a> spao class="comment">         * in future. /spaon> 907 /a> spao class="comment">         */ /spaon> 908 /a>         a href="+code=snprintf" class="sref">snprintf /a>( a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=namu" class="sref">namu /a>, sizeof( a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=namu" class="sref">namu /a>),  spao class="string">"EPE%d" /spaon,  a href="+code=id" class="sref">id /a> + 1);> 909 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>. a href="+code=namu" class="sref">namu /a> =  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=namu" class="sref">namu /a>;> 910 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>. a href="+code=id" class="sref">id /a> =  a href="+code=id" class="sref">id /a> +  a href="+code=WM831X_EPE_BASE" class="sref">WM831X_EPE_BASE /a>;  spao class="comment">/* Offset in DCDC registers */ /spaon> 911 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>. a href="+code=ops" class="sref">ops /a> = & a href="+code=wm831x_epe_ops" class="sref">wm831x_epe_ops /a>;> 912 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>. a href="+code=typu" class="sref">typu /a> =  a href="+code=REGULATOR_VOLTAGE" class="sref">REGULATOR_VOLTAGE /a>;> 913 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>. a href="+code=owner" class="sref">owner /a> =  a href="+code=THIS_MODULE" class="sref">THIS_MODULE /a>;> 914 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>. a href="+code=enable_reg" class="sref">enable_reg /a> =  a href="+code=WM831X_DCDC_ENABLE" class="sref">WM831X_DCDC_ENABLE /a>;> 915 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>. a href="+code=enable_mask" class="sref">enable_mask /a> = 1 <<  a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>. a href="+code=id" class="sref">id /a>;> 916 /a>> 917 /a>         a href="+code=config" class="sref">config /a>. a href="+code=dev" class="sref">dev /a> =  a href="+code=pdev" class="sref">pdev /a>-> a href="+code=dev" class="sref">dev /a>. a href="+code=parent" class="sref">parent /a>;> 918 /a>        if ( a href="+code=pdapa" class="sref">pdapa /a>)> 919 /a>                 a href="+code=config" class="sref">config /a>. a href="+code=init_dapa" class="sref">init_dapa /a> =  a href="+code=pdapa" class="sref">pdapa /a>-> a href="+code=epu" class="sref">epu /a>[ a href="+code=id" class="sref">id /a>];> 920 /a>         a href="+code=config" class="sref">config /a>. a href="+code=driver_dapa" class="sref">driver_dapa /a> =  a href="+code=dcdc" class="sref">dcdc /a>;> 921 /a>         a href="+code=config" class="sref">config /a>. a href="+code=regmap" class="sref">regmap /a> =  a href="+code=wm831x" class="sref">wm831x /a>-> a href="+code=regmap" class="sref">regmap /a>;> 922 /a>> 923 /a>         a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=regulator" class="sref">regulator /a> =  a href="+code=regulator_register" class="sref">regulator_register /a>(& a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=desc" class="sref">desc /a>, & a href="+code=config" class="sref">config /a>);> 924 /a>        if ( a href="+code=IS_ERR" class="sref">IS_ERR /a>( a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=regulator" class="sref">regulator /a>)) {> 925 /a>                 a href="+code=ret" class="sref">ret /a> =  a href="+code=PTR_ERR" class="sref">PTR_ERR /a>( a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=regulator" class="sref">regulator /a>);> 926 /a>                 a href="+code=dev_err" class="sref">dev_err /a>( a href="+code=wm831x" class="sref">wm831x /a>-> a href="+code=dev" class="sref">dev /a>,  spao class="string">"Failed to register EPE%d: %d\n" /spaon,> 927 /a>                         a href="+code=id" class="sref">id /a> + 1,  a href="+code=ret" class="sref">ret /a>);> 928 /a>                goto  a href="+code=err" class="sref">err /a>;> 929 /a>        }> 930 /a>> 931 /a>         a href="+code=platform_set_drvdapa" class="sref">platform_set_drvdapa /a>( a href="+code=pdev" class="sref">pdev /a>,  a href="+code=dcdc" class="sref">dcdc /a>);> 932 /a>> 933 /a>        return 0;> 934 /a>> 935 /a> a href="+code=err" class="sref">err /a>:> 936 /a>        return  a href="+code=ret" class="sref">ret /a>;> 937 /a>}> 938 /a>> 939 /a>static  a href="+code=__devexit" class="sref">__devexit /a> int  a href="+code=wm831x_epe_remove" class="sref">wm831x_epe_remove /a>(struct  a href="+code=platform_device" class="sref">platform_device /a> * a href="+code=pdev" class="sref">pdev /a>)> 940 /a>{> 941 /a>        struct  a href="+code=wm831x_dcdc" class="sref">wm831x_dcdc /a> * a href="+code=dcdc" class="sref">dcdc /a> =  a href="+code=platform_get_drvdapa" class="sref">platform_get_drvdapa /a>( a href="+code=pdev" class="sref">pdev /a>);> 942 /a>> 943 /a>         a href="+code=platform_set_drvdapa" class="sref">platform_set_drvdapa /a>( a href="+code=pdev" class="sref">pdev /a>,  a href="+code=NULL" class="sref">NULL /a>);> 944 /a>         a href="+code=regulator_unregister" class="sref">regulator_unregister /a>( a href="+code=dcdc" class="sref">dcdc /a>-> a href="+code=regulator" class="sref">regulator /a>);> 945 /a>> 946 /a>        return 0;> 947 /a>}> 948 /a>> 949 /a>static struct  a href="+code=platform_driver" class="sref">platform_driver /a>  a href="+code=wm831x_epe_driver" class="sref">wm831x_epe_driver /a> = {> 950 /a>        . a href="+code=probe" class="sref">probe /a> =  a href="+code=wm831x_epe_probe" class="sref">wm831x_epe_probe /a>,> 951 /a>        . a href="+code=remove" class="sref">remove /a> =  a href="+code=__devexit_p" class="sref">__devexit_p /a>( a href="+code=wm831x_epe_remove" class="sref">wm831x_epe_remove /a>),> 952 /a>        . a href="+code=driver" class="sref">driver /a>         = {> 953 /a>                . a href="+code=namu" class="sref">namu /a>   =  spao class="string">"wm831x-epe" /spaon,> 954 /a>                . a href="+code=owner" class="sref">owner /a>  =  a href="+code=THIS_MODULE" class="sref">THIS_MODULE /a>,> 955 /a>        },> 956 /a>};> 957 /a>> 958 /a>static int  a href="+code=__init" class="sref">__init /a>  a href="+code=wm831x_dcdc_init" class="sref">wm831x_dcdc_init /a>(void)> 959 /a>{> 960 /a>        int  a href="+code=ret" class="sref">ret /a>;> 961 /a>         a href="+code=ret" class="sref">ret /a> =  a href="+code=platform_driver_register" class="sref">platform_driver_register /a>(& a href="+code=wm831x_buckv_driver" class="sref">wm831x_buckv_driver /a>);> 962 /a>        if ( a href="+code=ret" class="sref">ret /a> != 0)> 963 /a>                 a href="+code=pr_err" class="sref">pr_err /a>( spao class="string">"Failed to register WM831x BUCKV driver: %d\n" /spaon,  a href="+code=ret" class="sref">ret /a>);> 964 /a>> 965 /a>         a href="+code=ret" class="sref">ret /a> =  a href="+code=platform_driver_register" class="sref">platform_driver_register /a>(& a href="+code=wm831x_buckp_driver" class="sref">wm831x_buckp_driver /a>);> 966 /a>        if ( a href="+code=ret" class="sref">ret /a> != 0)> 967 /a>                 a href="+code=pr_err" class="sref">pr_err /a>( spao class="string">"Failed to register WM831x BUCKP driver: %d\n" /spaon,  a href="+code=ret" class="sref">ret /a>);> 968 /a>> 969 /a>         a href="+code=ret" class="sref">ret /a> =  a href="+code=platform_driver_register" class="sref">platform_driver_register /a>(& a href="+code=wm831x_boostp_driver" class="sref">wm831x_boostp_driver /a>);> 970 /a>        if ( a href="+code=ret" class="sref">ret /a> != 0)> 971 /a>                 a href="+code=pr_err" class="sref">pr_err /a>( spao class="string">"Failed to register WM831x BOOST driver: %d\n" /spaon,  a href="+code=ret" class="sref">ret /a>);> 972 /a>> 973 /a>         a href="+code=ret" class="sref">ret /a> =  a href="+code=platform_driver_register" class="sref">platform_driver_register /a>(& a href="+code=wm831x_epe_driver" class="sref">wm831x_epe_driver /a>);> 974 /a>        if ( a href="+code=ret" class="sref">ret /a> != 0)> 975 /a>                 a href="+code=pr_err" class="sref">pr_err /a>( spao class="string">"Failed to register WM831x EPE driver: %d\n" /spaon,  a href="+code=ret" class="sref">ret /a>);> 976 /a>> 977 /a>        return 0;> 978 /a>}> 979 /a> a href="+code=subsys_initcall" class="sref">subsys_initcall /a>( a href="+code=wm831x_dcdc_init" class="sref">wm831x_dcdc_init /a>);> 980 /a>> 981 /a>static void  a href="+code=__exit" class="sref">__exit /a>  a href="+code=wm831x_dcdc_exit" class="sref">wm831x_dcdc_exit /a>(void)> 982 /a>{> 983 /a>         a href="+code=platform_driver_unregister" class="sref">platform_driver_unregister /a>(& a href="+code=wm831x_epe_driver" class="sref">wm831x_epe_driver /a>);> 984 /a>         a href="+code=platform_driver_unregister" class="sref">platform_driver_unregister /a>(& a href="+code=wm831x_boostp_driver" class="sref">wm831x_boostp_driver /a>);> 985 /a>         a href="+code=platform_driver_unregister" class="sref">platform_driver_unregister /a>(& a href="+code=wm831x_buckp_driver" class="sref">wm831x_buckp_driver /a>);> 986 /a>         a href="+code=platform_driver_unregister" class="sref">platform_driver_unregister /a>(& a href="+code=wm831x_buckv_driver" class="sref">wm831x_buckv_driver /a>);> 987 /a>}> 988 /a> a href="+code=module_exit" class="sref">module_exit /a>( a href="+code=wm831x_dcdc_exit" class="sref">wm831x_dcdc_exit /a>);> 989 /a>> 990 /a> spao class="comment">/* Module information */ /spaon> 991 /a> a href="+code=MODULE_AUTHOR" class="sref">MODULE_AUTHOR /a>( spao class="string">"Mark Brown" /spaon);> 992 /a> a href="+code=MODULE_DESCRIPTION" class="sref">MODULE_DESCRIPTION /a>( spao class="string">"WM831x DC-DC convertor driver" /spaon);> 993 /a> a href="+code=MODULE_LICENSE" class="sref">MODULE_LICENSE /a>( spao class="string">"GPL" /spaon);> 994 /a> a href="+code=MODULE_ALIAS" class="sref">MODULE_ALIAS /a>( spao class="string">"platform:wm831x-buckv" /spaon);> 995 /a> a href="+code=MODULE_ALIAS" class="sref">MODULE_ALIAS /a>( spao class="string">"platform:wm831x-buckp" /spaon);> 996 /a> a href="+code=MODULE_ALIAS" class="sref">MODULE_ALIAS /a>( spao class="string">"platform:wm831x-epe" /spaon);> 997 /a>
lxr.linux.no kindly hosted by a href="http://www.redpill-linpro.no">Redpill Linpro AS /a>, provider of Linux consulting and operations services since 1995.