[PATCH] Fwd: Re: /proc/acpi/ibm/volume broken on X20 since 2.6.22

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

Am Mittwoch 25 Juli 2007 03:08 schrieb Henrique de Moraes Holschuh:
> On Tue, 24 Jul 2007, Andreas Messer wrote:
> > Am Montag 23 Juli 2007 10:22 schrieb Henrique de Moraes Holschuh
> >
> > > On Sun, 22 Jul 2007, Andreas Messer wrote:
> > > > On Mon, Jul 09, 2007 at 10:35:23AM -0300, Henrique de Moraes Holschuh
> >
> > wrote:
> > > > > > but i think so. Up to Kernel 2.6.21 thinkpad-acpi was working
> > > > > > fine on my TP X20. Now, since 2.6.22 setting the volume seems to
> > > > > > be broken: "echo -n mute >/proc/acpi/ibm/volume" leads to an
> > > > > > I/O-Error. Doing
> > > > >
> I am at a loss to explain the problem.  You could test the latest
> thinkpad-acpi from ibm-acpi.sf.net for 2.6.22, maybe it fixes the issue for
> some unknown reason...
>
> or you could bissect 2.6.22 to find out what broke thinkpad-acpi.  This
> could be dangerous to data, so I'd do it using single-user boots when
> booting one of the kernels the bissect generates...
>
> or you could add some debugging printks to thinkpad-acpi volume code, to
> try to track why it doesn't work anymore :-(
>
> or you could try to find someone else with the same problem, that might
> help tracking it down, because I haven't managed to reproduce it yet.

Today stayed at home with headache. So time to fix that problem. And i found  
it. It was some Typos, happend while porting ibm_acpi->thinpad_acpi. I also
fixed something with the brightness, now even brightness works fine on my 
thinpad X20. You may mark on the project homepage everything on TP X20 
working: beep,brightness,fan,hotkey,led,light,thermal,volume,video. Patch 
following. 

greetings
Andreas
-- 
gnuPG keyid: 8C2BAF51
fingerprint: 28EE 8438 E688 D992 3661 C753 90B3 BAAA 8C2B AF51
*** thinkpad_acpi.c.orig	2007-07-25 13:57:06.000000000 +0200
--- thinkpad_acpi.c	2007-07-25 14:05:49.000000000 +0200
***************
*** 2743,2751 ****
  	cmos_cmd = value > current_value ? TP_CMOS_BRIGHTNESS_UP : TP_CMOS_BRIGHTNESS_DOWN;
  	inc = value > current_value ? 1 : -1;
  	for (i = current_value; i != value; i += inc) {
! 		if (issue_thinkpad_cmos_command(cmos_cmd))
! 			return -EIO;
! 		if (!acpi_ec_write(brightness_offset, i + inc))
  			return -EIO;
  	}
  
--- 2743,2750 ----
  	cmos_cmd = value > current_value ? TP_CMOS_BRIGHTNESS_UP : TP_CMOS_BRIGHTNESS_DOWN;
  	inc = value > current_value ? 1 : -1;
  	for (i = current_value; i != value; i += inc) {
! 		if (issue_thinkpad_cmos_command(cmos_cmd) &&
! 		    !acpi_ec_write(brightness_offset, i + inc))
  			return -EIO;
  	}
  
***************
*** 2790,2796 ****
  		} else
  			return -EINVAL;
  
! 		brightness_set(new_level);
  	}
  
  	return 0;
--- 2789,2795 ----
  		} else
  			return -EINVAL;
  
! 		return brightness_set(new_level);
  	}
  
  	return 0;
***************
*** 2860,2875 ****
  			cmos_cmd = new_level > level ? TP_CMOS_VOLUME_UP : TP_CMOS_VOLUME_DOWN;
  			inc = new_level > level ? 1 : -1;
  
! 			if (mute && (issue_thinkpad_cmos_command(cmos_cmd) ||
  				     !acpi_ec_write(volume_offset, level)))
  				return -EIO;
  
  			for (i = level; i != new_level; i += inc)
! 				if (issue_thinkpad_cmos_command(cmos_cmd) ||
  				    !acpi_ec_write(volume_offset, i + inc))
  					return -EIO;
  
! 			if (mute && (issue_thinkpad_cmos_command(TP_CMOS_VOLUME_MUTE) ||
  				     !acpi_ec_write(volume_offset,
  						    new_level + mute)))
  				return -EIO;
--- 2859,2874 ----
  			cmos_cmd = new_level > level ? TP_CMOS_VOLUME_UP : TP_CMOS_VOLUME_DOWN;
  			inc = new_level > level ? 1 : -1;
  
! 			if (mute && (issue_thinkpad_cmos_command(cmos_cmd) &&
  				     !acpi_ec_write(volume_offset, level)))
  				return -EIO;
  
  			for (i = level; i != new_level; i += inc)
! 				if (issue_thinkpad_cmos_command(cmos_cmd) &&
  				    !acpi_ec_write(volume_offset, i + inc))
  					return -EIO;
  
! 			if (mute && (issue_thinkpad_cmos_command(TP_CMOS_VOLUME_MUTE) &&
  				     !acpi_ec_write(volume_offset,
  						    new_level + mute)))
  				return -EIO;
***************
*** 2878,2884 ****
  		if (new_mute != mute) {	/* level doesn't change */
  			cmos_cmd = new_mute ? TP_CMOS_VOLUME_MUTE : TP_CMOS_VOLUME_UP;
  
! 			if (issue_thinkpad_cmos_command(cmos_cmd) ||
  			    !acpi_ec_write(volume_offset, level + new_mute))
  				return -EIO;
  		}
--- 2877,2883 ----
  		if (new_mute != mute) {	/* level doesn't change */
  			cmos_cmd = new_mute ? TP_CMOS_VOLUME_MUTE : TP_CMOS_VOLUME_UP;
  
! 			if (issue_thinkpad_cmos_command(cmos_cmd) &&
  			    !acpi_ec_write(volume_offset, level + new_mute))
  				return -EIO;
  		}

Attachment: pgpvymIc4NieG.pgp
Description: PGP signature

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
ibm-acpi-devel mailing list
ibm-acpi-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel

[Index of Archives]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Photo]     [Yosemite Photos]     [Yosemite Advice]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux