Battery charge controller interface to SOC

Hi All,

I have a requirement of interfacing a battery fuel gauge and battery controller via I2C to SoC. i.e there are no embedded controller in between( no smart battery). So ,as per my current understanding, I will have to use ACPI “Control Method Battery Interface” for the same. i.e edit the ACPI table DSDT to add battery related methods. Is this flow correct? Will chaging the ASL code and adding battery related control methods pass all the required information to cmbatt.sys(miniport driver). Do I need to write a mini port driver for this ? Kindly help me out as I am a beginner with windows development. Please do suggest if any alternative solutions are available.

Regards,
Parvathi

This is not a particularly good place for a beginner. The ACPI interfaces are not well-documented, the ACPI driver interface is practically not documented at all, and there’s very little helpful expertise available.

However, in theory, if you follow the guidelines and build your ACPI DSDT methods properly, then it should just plug and play, as you suggest. Have you looked at the DSDT for other laptops to see how they have exposed things?

1 Like

Thank you for your response. I am yet to look at DSDT for laptop. I agree that this is a huge task, but I wanted to know if this strategy is correct. i.e.

  1. If I am creating DSDT methods properly, can I reuse cmbatt.sys as it is , without writing another mini port driver or any other driver for windows?
  2. I need to map I2C lines and GPIO interrupt for handling ACPI methods and ACPI events. Is my understanding correct?
  3. Is there any other alternative solution that can be tried, which is easier than editing DSDT in ACPI?

I’m sorry to say, your question is well beyond the areas of my experience. Your OEM is going to have to find somebody at MSFT to guide you in terms of how best to integrate Windows with your platform. I have not even seen the code, for example, that does this work in (the former) Windows Mobile.

Now… having said that: If you don’t want to tightly integrate your solution with the OS… your job is simple. In that case, your battery is just another i2c connected peripheral… which folLows the SPB device model. You could write a very simple driver (based on the SpbTest sample in the WDK). Or… If you’re using Windows IOT Core, then you could just talk to the device from a C# program. Quite easily done.

Peter