AC Adapter

modulename: ac.ko

configname: CONFIG_ACPI_AC

Linux Kernel Configuration
└─>Power management and ACPI options
└─>ACPI (Advanced Configuration and Power Interface) Support
└─>AC Adapter
In linux kernel since version 4.2 (release Date: 2015-08-30)  
This driver supports the AC Adapter object, which indicates
whether a system is on AC or not. If you have a system that can
switch between A/C and battery, say Y.

To compile this driver as a module, choose M here:
the module will be called ac.

source code: