In order to control my backlight, I need to do the following:
sudo setpci -s 00:02.1 F4.B=x
This could be read as:
For the PCI device with the ID 00:02.1, set the register F4 (byte only) to x.
To figure out a value I want for x, I'd like to read its current value (in a script I'm writing). How do I do this?
This seems to be the domain of
lspci. I tried
sudo lspci -x -s 00:02.1
but this doesn't give enough range (doesn't reach register/address F4). I can do it with the
-xxx command line, however. This gives me a dump at which I can see the byte at F4, which I verified I can manipulate with the
setpci command. However, the manual says:
-xxx Show hexadecimal dump of the whole PCI configuration space. It is available only to root as several PCI devices crash when you try to read some parts of the config space (this behavior probably doesn't violate the PCI standard, but it's at least very stupid). However, such devices are rare, so you needn't worry much.
So I'd rather not put that in a program that runs automatically as root. Any way to just read the value for register F4? A
getpci program? A
setpci flag? Some special
lspci flag I missed?
(Environment is Ubuntu Netbook Remix 9.04 (karmic) (32-bit) on a Samsung N140 netbook)