Code Monkey home page Code Monkey logo

acer-switch-battery-module's Introduction

Battery driver for the Acer Switch 11 laptop.

A kernel module that reads the battery and AC plug status and reports them to the Linux kernel as a power supply.

Table of Contents

Reasons for this module

Neither the battery nor the mains plug of that laptop were correctly detected by Linux, since the BIOS provides a (very) broken DSDT. Since I was not able to fix the table, I wrote this kernel module in order to provide the battery information.

See this topic in the Arch Linux forums.

Usage

Since this is not an official kernel module you need to compile and load it yourself. Don't worry, it is not complicated.

Note that you need to compile the module on every kernel update!

Prerequisites

You need a compiler and the Linux headers for your Kernel version installed.

For pacman based systems:

# pacman -S linux-headers

For APT based systems:

# apt-get install linux-headers-$(uname -r)

Compile

It is as simple as cloning the repository and typing "make":

$ git clone https://github.com/jfrimmel/Acer-Switch-Battery-Module.git
$ cd Acer-Switch-Battery-Module
$ make

There shouldn't be any errors and a file "battery-module.ko" (along some others) is created. This is your kernel module.

Loading the module

It can be loaded using the following command:

# insmod battery-module.ko

Note that modprobe is generally a better choice than insmod since modprobe resolves dependencies, but this module has no dependencies and so insmod can be used as well.

Unloading the module

If you wish to remove the module at some point you simple execute the following command:

# rmmod battery-module.ko

You don't need to do this under normal circumstances.

Notes

If there is a battery detected without this module you should unload the driver for it before loading this kernel module.

Such a driver is most likely the module battery (for ACPI batteries) and ac (for ACPI AC adapters). They could either unloaded using rmmod or blacklisted.

To blacklist those modules execute the following command and reboot:

# echo 'blacklist battery' >> /etc/modprobe.d/blacklist.conf
# echo 'blacklist ac' >> /etc/modprobe.d/blacklist.conf

acer-switch-battery-module's People

Contributors

jfrimmel avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.