From 2b01bb114e19a6feec95785147ca575539461aae Mon Sep 17 00:00:00 2001 From: Jeff Curless Date: Mon, 6 Oct 2025 21:03:11 -0400 Subject: [PATCH] Minor changes code still working --- battery/install | 17 ++++++++++------- battery/oneUpPower.c | 19 +++++++------------ 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/battery/install b/battery/install index 7ff7768..0fa4660 100755 --- a/battery/install +++ b/battery/install @@ -1,11 +1,14 @@ + +sudo cp -vf oneUpPower.ko /lib/modules/`uname -r`/kernel/drivers/power/supply/oneUpPower.ko +ls /lib/modules/`uname -r`/kernel/drivers/power/supply/ sudo insmod oneUpPower.ko -ls -l /sys/class/power_supply/BAT0 -cat /sys/class/power_supply/BAT0/uevent -cat /sys/class/power_supply/BAT0/capacity -cat /sys/class/power_supply/BAT0/status - -ls -l /sys/class/power_supply/AC0 -cat /sys/class/power_supply/AC0/uevent +#ls -l /sys/class/power_supply/BAT0 +#cat /sys/class/power_supply/BAT0/uevent +#cat /sys/class/power_supply/BAT0/capacity +#cat /sys/class/power_supply/BAT0/status +# +#ls -l /sys/class/power_supply/AC0 +#cat /sys/class/power_supply/AC0/ueven diff --git a/battery/oneUpPower.c b/battery/oneUpPower.c index c0bf0b1..c454e11 100644 --- a/battery/oneUpPower.c +++ b/battery/oneUpPower.c @@ -225,28 +225,28 @@ static int system_monitor( void *args ) struct i2c_adapter *adapter = NULL; struct i2c_board_info board_info = {I2C_BOARD_INFO("argon40_battery", BATTERY_ADDR )}; - pr_info( "Starting system monitor..." ); + pr_info( "Starting system monitor...\n" ); // // Get an adapter so we can make an i2c client... // adapter = i2c_get_adapter( I2C_BUS ); if( adapter == NULL ){ - pr_err( "Unable to get i2c adapter!" ); + pr_err( "Unable to get i2c adapter!\n" ); return -1; } - pr_info( "Created an I2C adapter..." ); + pr_info( "Created an I2C adapter...\n" ); // // Build the i2c client... // client = i2c_new_client_device( adapter, &board_info ); if( client == NULL ){ - pr_err( "Unable to create i2c client1!" ); + pr_err( "Unable to create i2c client!\n" ); return -1; } - pr_info( "Created an I2C client device..." ); + pr_info( "Created an I2C client device...\n" ); // // Monitor until we are done... @@ -274,7 +274,7 @@ static int system_monitor( void *args ) i2c_put_adapter( adapter ); adapter = NULL; } - pr_info( "system monitor is stopping..." ); + pr_info( "system monitor is stopping...\n" ); return 0; } @@ -393,6 +393,7 @@ static int __init oneup_power_init(void) monitor_task = kthread_run( system_monitor, NULL, "argon40_monitor" ); if( monitor_task == NULL ){ + pr_err( "Could not start system_monitor, terminating.\n" ); goto failed; } @@ -441,12 +442,6 @@ static void __exit oneup_power_exit(void) } module_exit(oneup_power_exit); -static inline void signal_power_supply_changed(struct power_supply *psy) -{ - if (module_initialized) - power_supply_changed(psy); -} - MODULE_DESCRIPTION("Power supply driver for Argon40 1UP"); MODULE_AUTHOR("Jeff Curless "); MODULE_LICENSE("GPL");