1. 程式人生 > >新路程------imx6動態修改lvds channel

新路程------imx6動態修改lvds channel

#include <linux/fb.h>
#include <stdio.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
#include <linux/ioctl.h>
#include <unistd.h>  
#include <stdio.h>  
#include <stdlib.h>  
#include <fcntl.h>  
#include <linux/fb.h>  
#include <sys/mman.h>  
#include <math.h>
#include <unistd.h>  
#include <stdio.h>  
#include <stdlib.h>  
#include <fcntl.h>  
#include <linux/fb.h>  
#include <sys/mman.h>  


 #define FBIOSET_CHANNEL0x4622


 struct fb_var_screeninfo  vinfo;
void main(int argc, char * argv[])
{
   
    int fd = 0;
    int channel;


    int x =0;


     channel=atoi(argv[1]);
    printf("start ioctl \n");
    
  //  printf("matt-argc=%d\n",argc);
    
   
    fd = open("/dev/fb0",O_RDWR);
    if (fd < 0)
    {
        printf("matt-Open Dev Mem0 Error!\n");


    }
   sleep(5);    
     printf("matt-channel=%d\n",channel);
   
   
 //選擇channel  


  /* if (ioctl(fd,FBIOSET_CHANNEL,&channel))  
     {  
          printf("Error writeing variable information/n");  
          exit(3);  
     } */
      if (ioctl(fd,FBIOGET_VSCREENINFO,&vinfo))  
     {  
          printf("Error reading variable information/n");  
          exit(3);  
     } 
    close(fd);
    done: exit(0);