Fan Zone ACPI Code - I2C Support

Paulie_D 0 Reputation points
2023-09-25T21:00:13.3666667+00:00

I am trying to code an ACPI fan zone that utilizes an I2C HW Monitor/Fan Controller. What is the mechanism for accessing the I2C controller?

Do I need to create my own ACPI method for the read/write access of this device?

I have not found much on-line assistance on this issue but I cannot believe I am the only person with this requirement.

Windows for business Windows Client for IT Pros User experience Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 44,751 Reputation points
    2023-09-26T11:04:14.4166667+00:00
    Hello 
    
    Creating an ACPI fan zone that utilizes an I2C Hardware Monitor/Fan Controller involves a combination of ACPI (Advanced Configuration and Power Interface) and I2C (Inter-Integrated Circuit) communication. 
    
    First, you need to identify the specific I2C hardware monitor/fan controller device you are using. Make sure you have the necessary documentation and drivers for this device, as it will play a crucial role in the integration. Then, you'll need to create or modify ACPI tables to define the fan control zone. This typically involves modifying the DSDT (Differentiated System Description Table) and adding your custom methods and objects.
    
    Here's a simplified example:
    
    Method (ReadI2C, 2, Serialized) {
        // I2C read operation
        // Argument 0: I2C device address
        // Argument 1: Register address to read from
    
        // Perform I2C read operation and store result
        ...
    }
    
    Method (WriteI2C, 3, Serialized) {
        // I2C write operation
        // Argument 0: I2C device address
        // Argument 1: Register address to write to
        // Argument 2: Data to write
    
        // Perform I2C write operation
        ...
    }
    
    
    After, within your custom ACPI fan control methods, you can call the ReadI2C and WriteI2C methods you defined to communicate with the I2C hardware monitor/fan controller. For example, you can read sensor data or write fan control settings using these methods.
    
    Later, you will need to compile this information to be added into the firmware. You need a compiler to convert your ACPI source code into binary ACPI tables that your system can understand. The most commonly used ACPI compiler is the ACPI Compiler (ACPI CA), which includes the "iasl" (Intel ACPI Source Language) compiler.
    
    For example, compile syntax would be:
    iasl -tc <your_source_file.asl>
    
    You can verify and validate the compilation with:
    iasl -vr <your_source_file.asl>
    
    Last but not least, you have 2 options to load this into the bios:
    a)Some operating systems allow you to load custom ACPI tables during boot. This is often used for testing and development purposes. 
    b)Update BIOS/UEFI Firmware:You'll need to enter the BIOS/UEFI setup, find the option for updating ACPI tables, and upload your custom tables. The specific procedure depende on your motherboard or system manufacturer.
    
    
    --If the reply is helpful, please Upvote and Accept as answer--
    

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.