Permalink
Browse files

Add scripts, add support for Lenovo 4313CTO, LG R-590-5700, Sony AW29…

…0J, correct darkness for Sony VPCW1 and VPCW2, remove warning on Linux 2.6.39
  • Loading branch information...
1 parent d42587d commit e3329b798ba838d692972346c24b10452ff27957 @guillaumezin guillaumezin committed Jul 17, 2011
View
@@ -1,5 +1,5 @@
TARGET := nvidiabl
-VERSION := 0.69
+VERSION := 0.70
RELEASE_NAME := $(TARGET)-$(VERSION)
KVER := $(shell uname -r)
@@ -90,9 +90,10 @@ dkms-remove:
sudo dkms remove -m $(TARGET) -v $(VERSION) --all
sudo rm -rf /usr/src/$(TARGET)-$(VERSION)
-dkms-install: dkms-conf
+dkms-install: clean dkms-conf
sudo mkdir /usr/src/$(TARGET)-$(VERSION)
- sudo cp -f * /usr/src/$(TARGET)-$(VERSION)
+ sudo cp -rf * /usr/src/$(TARGET)-$(VERSION)
+ sudo rm -rf /usr/src/$(TARGET)-$(VERSION)/.git /usr/src/$(TARGET)-$(VERSION)/scripts
sudo dkms add build install -m $(TARGET) -v $(VERSION)
dkms-release:
View
4 README
@@ -137,9 +137,9 @@ sudo modprobe nvidiabl min=50 max=500
I can change the backlight value from the power settings GUI but my Fn keys are not working:
____________________________________________________________________________________________
-On https://github.com/guillaumezin/nvidiabl, I attached some ACPI scripts examples that permit on my laptop to use Fn keys to change the backlight settings. This is an ugly workaround (you don't have OSD this way), good practive should be to have a look at the /usr/share/doc/udev/README.keymap.txt.gz and fill a bug report.
+On https://github.com/guillaumezin/nvidiabl/blob/master/scripts, there are bash (in /usr/local/sbin) and ACPI (in /etc) scripts examples that permit on my laptop to use Fn keys to change the backlight settings. This is an ugly workaround (you don't have OSD this way), good practice should be to have a look at the /usr/share/doc/udev/README.keymap.txt.gz and fill a bug report.
-There is some intereting scripts here too: http://dev.osource.se/software/obacklight/.
+There is some intereting scripts here too: http://dev.osource.se/software/obacklight.
nVidia staff is of course free to ship this driver with theirs!
View
@@ -1,6 +1,6 @@
DEST_MODULE_LOCATION[0]="/kernel/drivers/video/backlight"
PACKAGE_NAME="nvidiabl"
-PACKAGE_VERSION="0.69"
+PACKAGE_VERSION="0.70"
CLEAN="make -C ${kernel_source_dir} SUBDIRS=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build clean"
BUILT_MODULE_NAME[0]="${PACKAGE_NAME}"
MODULES_CONF[0]="# Prevent conflicts with nvidiabl"
View
@@ -38,11 +38,11 @@
*/
NVIDIABL_DECLARE_LAPTOP_MODEL("Sony Corporation", "VGN-AW11", PCI_ANY_ID, NVIDIABL_AUTO, NVIDIABL_AUTO, NVIDIABL_AUTO),
-NVIDIABL_DECLARE_LAPTOP_MODEL("Sony Corporation", "VGN-AW290J", PCI_ANY_ID, NVIDIABL_AUTO, NVIDIABL_AUTO, NVIDIABL_AUTO)
+NVIDIABL_DECLARE_LAPTOP_MODEL("Sony Corporation", "VGN-AW290J", PCI_ANY_ID, NVIDIABL_AUTO, NVIDIABL_AUTO, NVIDIABL_AUTO),
NVIDIABL_DECLARE_LAPTOP_MODEL("Sony Corporation", "VGN-FZ11", PCI_ANY_ID, NVIDIABL_AUTO, NVIDIABL_AUTO, NVIDIABL_AUTO),
NVIDIABL_DECLARE_LAPTOP_MODEL("Sony Corporation", "VGN-FZ38", PCI_ANY_ID, NVIDIABL_AUTO, NVIDIABL_AUTO, NVIDIABL_AUTO),
-NVIDIABL_DECLARE_LAPTOP_MODEL("Sony Corporation", "VPCCW1", PCI_ANY_ID, NVIDIABL_AUTO, NVIDIABL_AUTO, NVIDIABL_AUTO),
-NVIDIABL_DECLARE_LAPTOP_MODEL("Sony Corporation", "VPCCW2", PCI_ANY_ID, NVIDIABL_AUTO, NVIDIABL_AUTO, NVIDIABL_AUTO),
+NVIDIABL_DECLARE_LAPTOP_MODEL("Sony Corporation", "VPCCW1", PCI_ANY_ID, NVIDIABL_AUTO, NVIDIABL_AUTO, 0x1FFFF),
+NVIDIABL_DECLARE_LAPTOP_MODEL("Sony Corporation", "VPCCW2", PCI_ANY_ID, NVIDIABL_AUTO, NVIDIABL_AUTO, 0x1FFFF),
NVIDIABL_DECLARE_LAPTOP_MODEL("Sony Corporation", "VPCS1", PCI_ANY_ID, NVIDIABL_AUTO, NVIDIABL_AUTO, NVIDIABL_AUTO),
NVIDIABL_DECLARE_LAPTOP_MODEL("Sony Corporation", "VGN-S560", PCI_ANY_ID, NVIDIABL_AUTO, NVIDIABL_AUTO, NVIDIABL_AUTO),
NVIDIABL_DECLARE_LAPTOP_MODEL("Sony Corporation", "VPCF1", PCI_ANY_ID, NVIDIABL_AUTO, NVIDIABL_AUTO, NVIDIABL_AUTO),
@@ -72,4 +72,7 @@ NVIDIABL_DECLARE_LAPTOP_MODEL("Apple Inc.", "MacBookAir2,1", PCI_ANY_ID, NVIDIAB
NVIDIABL_DECLARE_LAPTOP_MODEL("Apple Inc.", "MacBookAir3,1", PCI_ANY_ID, NVIDIABL_AUTO, NVIDIABL_AUTO, NVIDIABL_AUTO),
NVIDIABL_DECLARE_LAPTOP_MODEL("Apple Inc.", "MacBookAir3,2", PCI_ANY_ID, NVIDIABL_AUTO, NVIDIABL_AUTO, NVIDIABL_AUTO),
-NVIDIABL_DECLARE_LAPTOP_MODEL("LENOVO", "4313CTO", PCI_ANY_ID, 0, 1, NVIDIABL_AUTO),
+NVIDIABL_DECLARE_LAPTOP_MODEL("LENOVO", "4313CTO", PCI_ANY_ID, NVIDIABL_AUTO, NVIDIABL_AUTO, NVIDIABL_AUTO),
+
+NVIDIABL_DECLARE_LAPTOP_MODEL("LG Electronics", "R590-P.BN58P1", PCI_ANY_ID, NVIDIABL_AUTO, NVIDIABL_AUTO, 0x679a),
+
View
@@ -215,6 +215,9 @@ static int __init nvidiabl_init(void)
/* Register at backlight framework */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)
memset(&props, 0, sizeof(struct backlight_properties));
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)
+ props.type = BACKLIGHT_RAW;
+#endif
nvidiabl_device = backlight_device_register("nvidia_backlight", NULL,
driver_data,
&driver_data->backlight_ops,
@@ -0,0 +1,2 @@
+event=sony/hotkey SNC 00000001 00000010
+action=/etc/acpi/nvidia_backlight_down.sh
@@ -0,0 +1,2 @@
+event=sony/hotkey SNC 00000001 00000011
+action=/etc/acpi/nvidia_backlight_up.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+test -f /sys/class/backlight/nvidia_backlight/brightness || exit 0
+
+VAL=`cat /sys/class/backlight/nvidia_backlight/actual_brightness`
+MIN=0
+STEP=10
+
+VAL=`expr $VAL - $STEP`
+
+if [ $VAL -lt $MIN ]; then
+ VAL=$MIN
+fi
+
+echo -n $VAL > /sys/class/backlight/nvidia_backlight/brightness
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+test -f /sys/class/backlight/nvidia_backlight/brightness || exit 0
+
+VAL=`cat /sys/class/backlight/nvidia_backlight/actual_brightness`
+MAX=`cat /sys/class/backlight/nvidia_backlight/max_brightness`
+STEP=10
+
+VAL=`expr $VAL + $STEP`
+
+if [ $VAL -gt $MAX ]; then
+ VAL=$MAX
+fi
+
+echo -n $VAL > /sys/class/backlight/nvidia_backlight/brightness
@@ -0,0 +1,79 @@
+#!/bin/bash
+#
+# nvidiablctl v0.2
+#
+# Copyright (c) 2011, Piotr Karbowski <piotr.karbowski@gmail.com>
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification, are
+# permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice, this
+# list of conditions and the following disclaimer in the documentation and/or other
+# materials provided with the distribution.
+# * Neither the name of the Piotr Karbowski nor the names of its contributors may be
+# used to endorse or promote products derived from this software without specific
+# prior written permission.
+
+backlights_path='/sys/class/backlight/nvidia_backlight'
+max_brightness="$(< ${backlights_path}/max_brightness)"
+current_brightness="$(< ${backlights_path}/actual_brightness)"
+
+adjust_brightness() {
+ if [ "$1" -gt "${max_brightness}" ]; then
+ new_value="${max_brightness}"
+ elif [ "$1" -lt '0' ]; then
+ new_value="0"
+ else
+ new_value="$1"
+ fi
+ echo "${new_value}" > "${backlights_path}/brightness"
+}
+
+printhelp() {
+ name="${0##*/}"
+ echo " * ${name} v0.1
+
+ ${name} up
+ brightness +10
+
+ ${name} down
+ brightness -10
+
+ ${name} full
+ full brightness
+
+ ${name} off
+ turn off screen (brightness 0)
+
+ ${name} set <n>
+ set brightness to <n>
+"
+}
+
+case "$1" in
+ up)
+ adjust_brightness "$((${current_brightness}+10))"
+ ;;
+ down)
+ adjust_brightness "$((${current_brightness}-10))"
+ ;;
+ off)
+ adjust_brightness '0'
+ ;;
+ full)
+ adjust_brightness "${max_brightness}"
+ ;;
+ set)
+ if [ -n "$2" ] && [[ "$2" =~ ^[0-9]+$ ]]; then
+ adjust_brightness "$2"
+ else
+ echo "set need numeric second argument."; exit 1
+ fi
+ ;;
+ *)
+ printhelp; exit 1
+ ;;
+esac

0 comments on commit e3329b7

Please sign in to comment.