User:Knuxify/Old BCM590xx regulator notes: Difference between revisions
 Created page with "== Revisions ==  BCMPMU_59054_ID is ID for 59054  BCMPMU_59054A1_ANA_REV refers to A1 which has ACLD, A0 does not  == Downstream driver notes ==  * The downstream driver used is BCM59xxx, which despite the name is only for the BCM59054 ** In the tree there are also drivers for BCM59056, a handful of other PMUs including BCM59055, and BCM590xx (which confusingly is '''not''' the same as BCM59xxx). * The whole driver is fragmented as it's an MFD device, but the most import..."  | 
				No edit summary  | 
				||
| Line 53: | Line 53: | ||
};      | };      | ||
</syntaxhighlight>  | </syntaxhighlight>  | ||
...a PC reference? You'll see these in the next section.  | ...a PC reference? You'll see these in the next section.  | ||
| Line 70: | Line 71: | ||
The functions <code>__is_2bit_pmmode_regl_enabled</code> and <code>__is_3bit_pmmode_regl_enabled</code> check if a regulator is enabled based on those pin maps, and the <code>pmmode</code> value as read out from the PMMODE registers.  | The functions <code>__is_2bit_pmmode_regl_enabled</code> and <code>__is_3bit_pmmode_regl_enabled</code> check if a regulator is enabled based on those pin maps, and the <code>pmmode</code> value as read out from the PMMODE registers.  | ||
For every <code>i</code> from 0 to 7 (<code>REGL_PMMODE_VAL_MAX</code>): * get the PM reg shift by <code>PMMODE_2BIT_PMx_MASK & i</code> (PMMODE_2BIT_PMx_MASK == 3) * if this <code>i</code> gives a value through <code>setval & i</code> in set0 or set1, then the value of whether the regulator is enabled is calculated using <code>PMMODE_2BIT_PMx_MASK & (pmmode[inx] >> shift)</code>, where <code>inx</code> is increased for every value where <code>PMMODE_2BIT_PMx_MASK & i</code> == 3.  | For every <code>i</code> from 0 to 7 (<code>REGL_PMMODE_VAL_MAX</code>):  | ||
* get the PM reg shift by <code>PMMODE_2BIT_PMx_MASK & i</code> (PMMODE_2BIT_PMx_MASK == 3)  | |||
* if this <code>i</code> gives a value through <code>setval & i</code> in set0 or set1, then the value of whether the regulator is enabled is calculated using <code>PMMODE_2BIT_PMx_MASK & (pmmode[inx] >> shift)</code>, where <code>inx</code> is increased for every value where <code>PMMODE_2BIT_PMx_MASK & i</code> == 3.  | |||
In normal words: if the mode corresponding to the pin in ''any'' of the PMMODE registers is ON, then the regulator is on.  | In normal words: if the mode corresponding to the pin in ''any'' of the PMMODE registers is ON, then the regulator is on.  | ||
| Line 107: | Line 111: | ||
This one's similar to the previous function:  | This one's similar to the previous function:  | ||
For every <code>i</code> from 0 to 7 (<code>REGL_PMMODE_VAL_MAX</code>): * If the value is in set0 or set1, set the value to <code>PMMODE_ON</code>; otherwise, use '''<code>dsm_pmmode</code>''' (a variable passed at init time). Oooh, DSM again! * Figure out the shift and register like before. * Add the value to a temp variable by ORing <code>val << shift</code> to it.  | For every <code>i</code> from 0 to 7 (<code>REGL_PMMODE_VAL_MAX</code>):  | ||
* If the value is in set0 or set1, set the value to <code>PMMODE_ON</code>; otherwise, use '''<code>dsm_pmmode</code>''' (a variable passed at init time). Oooh, DSM again!  | |||
* Figure out the shift and register like before.  | |||
* Add the value to a temp variable by ORing <code>val << shift</code> to it.  | |||
Here's the thing: <code>dsm_pmmode</code>... is the mode value provided in <code>__bcmpmuldo_set_mode</code>.  | Here's the thing: <code>dsm_pmmode</code>... is the mode value provided in <code>__bcmpmuldo_set_mode</code>.  | ||