Hi Dieter,
Per the permission model in the Qualcomm platforms you are likely not allowed to work the regulator directly with the PMIC, instead you must make your requests to the resource power manager (RPM), which is controlling most of the regulators provided by the PMIC.
To do this you have to issue RPM requests over SMD.
Looking at the specific LK tag I see that 8916 does not do any such operations currently (and doesn’t even initialize SMD). It does however do this for 8994, so we have all the code for doing this.
So, based on msm8994 as reference, you would need to:
- enable “ENABLE_SMD_SUPPORT”
- define SMD_IRQ for 8916 - seems to be 168
- define APCS_ALIAS0_IPC_INTERRUPT as 0x0b011008
- make sure to call rpm_smd_init() from your target_init()
- similar to target/msm8994/regulator.c call rpm_send_data() on something like this
static uint32_t ldo15[] = {
LDOA_RES_TYPE, 15
KEY_SOFTWARE_ENABLE, 4, GENERIC_ENABLE,
KEY_MICRO_VOLT, 4, some_voltage,
};
rpm_send_data(ldo15, sizeof(ldo15) - 2, RPM_REQUEST_TYPE);
This request is for LDO 15 on the primary (the A in ldoA) PMIC. The packets are of [key, length, value] format, so we’re asking to change the value of “enable” and “micro_volt”, each takes 4 bytes of parameters and the values are “enable” and “some_voltage” (e.g. 1800000) respectively.
Unfortunately I now see what the difference between 8916 and 8994 is in terms of SMD. LK will leave the RPM SMD channel in a state where the Linux kernel won’t trigger the initialization of regulator, so you can use this to implement your LK feature but I need to figure out how to fix the kernel to live with this.
Regards,
Bjorn