View Single Post
Old 12-19-10, 01:52 PM   #90
tafano
Registered User
 
Join Date: Dec 2010
Posts: 2
Default Re: Linux backlight driver

This is the result:

Code:
stefano@stefano-laptop:~$ lspci -nn
00:00.0 Host bridge [0600]: Intel Corporation Mobile PM965/GM965/GL960 Memory Controller Hub [8086:2a00] (rev 03)
00:01.0 PCI bridge [0604]: Intel Corporation Mobile PM965/GM965/GL960 PCI Express Root Port [8086:2a01] (rev 03)
00:1a.0 USB Controller [0c03]: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #4 [8086:2834] (rev 03)
00:1a.1 USB Controller [0c03]: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #5 [8086:2835] (rev 03)
00:1a.7 USB Controller [0c03]: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #2 [8086:283a] (rev 03)
00:1b.0 Audio device [0403]: Intel Corporation 82801H (ICH8 Family) HD Audio Controller [8086:284b] (rev 03)
00:1c.0 PCI bridge [0604]: Intel Corporation 82801H (ICH8 Family) PCI Express Port 1 [8086:283f] (rev 03)
00:1c.1 PCI bridge [0604]: Intel Corporation 82801H (ICH8 Family) PCI Express Port 2 [8086:2841] (rev 03)
00:1c.3 PCI bridge [0604]: Intel Corporation 82801H (ICH8 Family) PCI Express Port 4 [8086:2845] (rev 03)
00:1d.0 USB Controller [0c03]: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #1 [8086:2830] (rev 03)
00:1d.1 USB Controller [0c03]: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #2 [8086:2831] (rev 03)
00:1d.2 USB Controller [0c03]: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #3 [8086:2832] (rev 03)
00:1d.7 USB Controller [0c03]: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #1 [8086:2836] (rev 03)
00:1e.0 PCI bridge [0604]: Intel Corporation 82801 Mobile PCI Bridge [8086:2448] (rev f3)
00:1f.0 ISA bridge [0601]: Intel Corporation 82801HEM (ICH8M) LPC Interface Controller [8086:2815] (rev 03)
00:1f.2 IDE interface [0101]: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) SATA IDE Controller [8086:2828] (rev 03)
00:1f.3 SMBus [0c05]: Intel Corporation 82801H (ICH8 Family) SMBus Controller [8086:283e] (rev 03)
01:00.0 VGA compatible controller [0300]: nVidia Corporation G86 [GeForce 8400M GS] [10de:0427] (rev a1)
03:00.0 Network controller [0280]: Intel Corporation PRO/Wireless 4965 AG or AGN [Kedron] Network Connection [8086:4229] (rev 61)
04:00.0 Ethernet controller [0200]: Marvell Technology Group Ltd. 88E8039 PCI-E Fast Ethernet Controller [11ab:4353] (rev 15)
05:09.0 CardBus bridge [0607]: Ricoh Co Ltd RL5c476 II [1180:0476] (rev b4)
05:09.1 SD Host controller [0805]: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter [1180:0822] (rev 18)
05:09.2 System peripheral [0880]: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter [1180:0592] (rev 09)
05:09.3 System peripheral [0880]: Ricoh Co Ltd xD-Picture Card Controller [1180:0852] (rev 04)
stefano@stefano-laptop:~$ cat /sys/class/dmi/id/sys_vendor
SAMSUNG ELECTRONICS CO., LTD.
stefano@stefano-laptop:~$ cat /sys/class/dmi/id/product_name
SR70S/SR71S
stefano@stefano-laptop:~$
I have written a a few line of C code, that allows me to change brightness using a "lanciatore" (I think the English translation i thrower, but I'm not shure). Anyway, my program works only in the exact directory, and now I can't use it from an hot-key of the keyboard (It returns an error, but I can't understand why...).
Anyway, if it can be useful, this is the code:

Code:
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>


int main(int argc, char *argv[], char *envp[])
{ int LumAttuale;
  FILE *F;
   if (!strcmp(argv[1],"-i")) {
    char in1[40], in2[15];
    system("smartdimmer -g > .gestioneLumi/out.txt");
    F=fopen(".gestioneLumi/out.txt","r" );
      fscanf(F,"%s %s %d", in1 ,in2 ,&LumAttuale);    
    LumAttuale+=10;
    strcpy (in1,"smartdimmer --s ");
    sprintf(in1, "%s %d", "smartdimmer --s", LumAttuale);
    
    if (LumAttuale!=100) { system(in1); };}

    
    if (!strcmp(argv[1],"-d")) {
    char in1[40], in2[15];
     system("smartdimmer -g > .gestioneLumi/out.txt");
    F=fopen(".gestioneLumi/out.txt","r" );
      fscanf(F,"%s %s %d", in1 ,in2 ,&LumAttuale);    
    LumAttuale-=10;
    strcpy (in1,"smartdimmer --s ");
    sprintf(in1, "%s %d", "smartdimmer --s", LumAttuale);
    
    if (LumAttuale>14) { system(in1); } else { system("smartdimmer --s 15");};}
return 0;

}
tafano is offline   Reply With Quote