Mainline:Broadcom Kona/Power Manager: Difference between revisions

 
Line 40: Line 40:
Next, the sequencer is disabled (<code>pwr_mgr_pm_i2c_enable(false)</code> - [[#I2C_ENABLE_OFFSET - 0x4100]]) and initialized with the provided data (<code>pwr_mgr_init_sequencer(info);</code>).
Next, the sequencer is disabled (<code>pwr_mgr_pm_i2c_enable(false)</code> - [[#I2C_ENABLE_OFFSET - 0x4100]]) and initialized with the provided data (<code>pwr_mgr_init_sequencer(info);</code>).


<code>pwr_mgr_init_sequencer</code>: * writes the I2C commands from <code>info-&gt;i2c_cmds</code> using <code>pwr_mgr_pm_i2c_cmd_write</code> * writes the data from <code>info-&gt;i2c_var_data</code> using <code>pwr_mgr_pm_i2c_var_data_write</code> * writes command pointers for each volt ??? from <code>info-&gt;i2c_cmd_ptr</code> using <code>pwr_mgr_set_v0x_specific_i2c_cmd_ptr</code>
<code>pwr_mgr_init_sequencer</code>:


Back to <code>pwr_mgr_init</code>, it sets <code>pwr_mgr.i2c_seq_trg = 0</code> and calls the following: * <code>init_completion(&amp;pwr_mgr.i2c_seq_done);</code> - this sets up a [https://embetronicx.com/tutorials/linux/device-drivers/completion-in-linux/ completion handler] (<code>include/linux/completion.h</code>) * <code>INIT_WORK(&amp;pwr_mgr.pwrmgr_work, pwr_mgr_work_handler);</code> - this sets up a [https://www.oreilly.com/library/view/understanding-the-linux/0596005652/ch04s08.html work queue] (<code>kernel/workqueue.c</code>).
* writes the I2C commands from <code>info-&gt;i2c_cmds</code> using <code>pwr_mgr_pm_i2c_cmd_write</code>
* writes the data from <code>info-&gt;i2c_var_data</code> using <code>pwr_mgr_pm_i2c_var_data_write</code>
* writes command pointers for each volt ??? from <code>info-&gt;i2c_cmd_ptr</code> using <code>pwr_mgr_set_v0x_specific_i2c_cmd_ptr</code>
 
Back to <code>pwr_mgr_init</code>, it sets <code>pwr_mgr.i2c_seq_trg = 0</code> and calls the following:
 
* <code>init_completion(&amp;pwr_mgr.i2c_seq_done);</code> - this sets up a [https://embetronicx.com/tutorials/linux/device-drivers/completion-in-linux/ completion handler] (<code>include/linux/completion.h</code>)
* <code>INIT_WORK(&amp;pwr_mgr.pwrmgr_work, pwr_mgr_work_handler);</code> - this sets up a [https://www.oreilly.com/library/view/understanding-the-linux/0596005652/ch04s08.html work queue] (<code>kernel/workqueue.c</code>).


Then, it runs <code>pwr_mgr_mask_intr(PWRMGR_INTR_ALL, true);</code> to mask all interrupts by default.
Then, it runs <code>pwr_mgr_mask_intr(PWRMGR_INTR_ALL, true);</code> to mask all interrupts by default.
Line 130: Line 137:


<span id="events"></span>
<span id="events"></span>
== Events ==
== Events ==