| .. | .. |
|---|
| 39 | 39 | #define BT_MBI_UNIT_PMC 0x04 |
|---|
| 40 | 40 | #define BT_MBI_UNIT_GFX 0x06 |
|---|
| 41 | 41 | #define BT_MBI_UNIT_SMI 0x0C |
|---|
| 42 | +#define BT_MBI_UNIT_CCK 0x14 |
|---|
| 42 | 43 | #define BT_MBI_UNIT_USB 0x43 |
|---|
| 43 | 44 | #define BT_MBI_UNIT_SATA 0xA3 |
|---|
| 44 | 45 | #define BT_MBI_UNIT_PCIE 0xA6 |
|---|
| .. | .. |
|---|
| 105 | 106 | * the PMIC bus while another driver is also accessing the PMIC bus various bad |
|---|
| 106 | 107 | * things happen. |
|---|
| 107 | 108 | * |
|---|
| 108 | | - * To avoid these problems this function must be called before accessing the |
|---|
| 109 | | - * P-Unit or the PMIC, be it through iosf_mbi* functions or through other means. |
|---|
| 109 | + * Call this function before sending requests to the P-Unit which may make it |
|---|
| 110 | + * access the PMIC, be it through iosf_mbi* functions or through other means. |
|---|
| 111 | + * This function will block all kernel access to the PMIC I2C bus, so that the |
|---|
| 112 | + * P-Unit can safely access the PMIC over the shared I2C bus. |
|---|
| 110 | 113 | * |
|---|
| 111 | 114 | * Note on these systems the i2c-bus driver will request a sempahore from the |
|---|
| 112 | 115 | * P-Unit for exclusive access to the PMIC bus when i2c drivers are accessing |
|---|
| .. | .. |
|---|
| 121 | 124 | * iosf_mbi_punit_release() - Release access to the P-Unit |
|---|
| 122 | 125 | */ |
|---|
| 123 | 126 | void iosf_mbi_punit_release(void); |
|---|
| 127 | + |
|---|
| 128 | +/** |
|---|
| 129 | + * iosf_mbi_block_punit_i2c_access() - Block P-Unit accesses to the PMIC bus |
|---|
| 130 | + * |
|---|
| 131 | + * Call this function to block P-Unit access to the PMIC I2C bus, so that the |
|---|
| 132 | + * kernel can safely access the PMIC over the shared I2C bus. |
|---|
| 133 | + * |
|---|
| 134 | + * This function acquires the P-Unit bus semaphore and notifies |
|---|
| 135 | + * pmic_bus_access_notifier listeners that they may no longer access the |
|---|
| 136 | + * P-Unit in a way which may cause it to access the shared I2C bus. |
|---|
| 137 | + * |
|---|
| 138 | + * Note this function may be called multiple times and the bus will not |
|---|
| 139 | + * be released until iosf_mbi_unblock_punit_i2c_access() has been called the |
|---|
| 140 | + * same amount of times. |
|---|
| 141 | + * |
|---|
| 142 | + * Return: Nonzero on error |
|---|
| 143 | + */ |
|---|
| 144 | +int iosf_mbi_block_punit_i2c_access(void); |
|---|
| 145 | + |
|---|
| 146 | +/* |
|---|
| 147 | + * iosf_mbi_unblock_punit_i2c_access() - Release PMIC I2C bus block |
|---|
| 148 | + * |
|---|
| 149 | + * Release i2c access block gotten through iosf_mbi_block_punit_i2c_access(). |
|---|
| 150 | + */ |
|---|
| 151 | +void iosf_mbi_unblock_punit_i2c_access(void); |
|---|
| 124 | 152 | |
|---|
| 125 | 153 | /** |
|---|
| 126 | 154 | * iosf_mbi_register_pmic_bus_access_notifier - Register PMIC bus notifier |
|---|
| .. | .. |
|---|
| 157 | 185 | */ |
|---|
| 158 | 186 | int iosf_mbi_unregister_pmic_bus_access_notifier_unlocked( |
|---|
| 159 | 187 | struct notifier_block *nb); |
|---|
| 160 | | - |
|---|
| 161 | | -/** |
|---|
| 162 | | - * iosf_mbi_call_pmic_bus_access_notifier_chain - Call PMIC bus notifier chain |
|---|
| 163 | | - * |
|---|
| 164 | | - * @val: action to pass into listener's notifier_call function |
|---|
| 165 | | - * @v: data pointer to pass into listener's notifier_call function |
|---|
| 166 | | - */ |
|---|
| 167 | | -int iosf_mbi_call_pmic_bus_access_notifier_chain(unsigned long val, void *v); |
|---|
| 168 | 188 | |
|---|
| 169 | 189 | /** |
|---|
| 170 | 190 | * iosf_mbi_assert_punit_acquired - Assert that the P-Unit has been acquired. |
|---|