linux logo 변경하기.

1. 관련 프로그램을 설치한다.

$ sudo apt-get install netpbm


2. 파일 변형
$ pngtopnm install_boot.png > install_boot.pnm
$ pnmquant 224 ./install_boot.pnm > install_boot.ppm
  (  컴파일 중 "logo image has more than 224 colors" 메세지가 나올 경우 반드시 실행해야 함  - 1024 x 600의 이미지를 사용할 경우 나타남 )
$ pnmnoraw install_boot.ppm > logo_bumnux_clut224.ppm

3. logo 파일 복사
$ cp logo_bumnux_clut224.ppm ../kernel/drivers/video/logo/logo_bumnux_clut224.ppm


4. linux_logo.h  에서 다음 추가 ( include/linux/linux_logo.h)
38 extern const struct linux_logo logo_bumnux_clut224;

5. Makefile 및 Kconfig 수정 ( drivers/video/logo/ )
-> Makefile
7 obj-$(CONFIG_LOGO_BUMNUX_CLUT224) += logo_bumnux_clut224.o

-> Kconfig
30 config LOGO_BUMNUX_CLUT224
31 bool "Standard 224-color bumnux logo"
32 default y


6. logo.c 파일 수정 ( drivers/video/logo/ )
70 #ifdef CONFIG_LOGO_BUMNUX_CLUT224
71 /* Generic BUMNUX logo */
72 logo = &logo_bumnux_clut224;
73 #endif


'Kernel & Uboot' 카테고리의 다른 글

u-boot home page  (0) 2012.08.17
i2c probe함수 호출 및 dev i2c addr등록 방법  (0) 2012.07.15
Video for Linux Two API Specification  (0) 2012.05.29
sysfs 다루기  (0) 2011.11.15
S5PC100 FIMC와 S3C6410 FIMC와의 차이  (0) 2011.03.03

'Kernel & Uboot' 카테고리의 다른 글

linux logo 변경하기.  (0) 2012.10.08
i2c probe함수 호출 및 dev i2c addr등록 방법  (0) 2012.07.15
Video for Linux Two API Specification  (0) 2012.05.29
sysfs 다루기  (0) 2011.11.15
S5PC100 FIMC와 S3C6410 FIMC와의 차이  (0) 2011.03.03

[펌] http://blog.naver.com/PostView.nhn?blogId=green187&logNo=110129376501


machine init시에 다음 함수를 추가한다.(테스트 당시 arch/arm/mach-s3c2440/mach-smdk2440.c에 추가함.)

static struct i2c_board_info i2c_devs0[]    __initdata = {
        {   I2C_BOARD_INFO("eeprom",0x53),},

         // I2C_BOARD_INFO 함수의 첫번째 파라메터는 device driver에서 사용할 i2c_device_id와 동일해야함, 두번째파라메터는 device address를 넣는다.
};

 static void __init smdk2440_machine_init(void)

{

    s3c24xx_fb_set_platdata(&smdk2440_fb_info);
    s3c_i2c0_set_platdata(NULL);
    i2c_register_board_info(0, i2c_devs0, ARRAY_SIZE(i2c_devs0));

    platform_add_devices(smdk2440_devices, ARRAY_SIZE(smdk2440_devices));
    smdk_machine_init();
}


i2c device driver에서는 다음 형식으로 소스를 작성한다.

#define DEVICE_NAME     "eeprom"
static const struct i2c_device_id eep_id[] = {
    {   DEVICE_NAME, 0 },
    {   }  
};

 

static struct i2c_driver eep_driver =
{
    .driver = {
        .name       =   DEVICE_NAME,
    }, 
    .id_table       =   eep_id,
    .probe          =   eep_probe,
    .remove         =   eep_remove,
};

eep_probe함수가 호출되고 , i2c_master_send / i2c_master_recv함수를 통해 I2C device에 접근 할 수 있다.

'Kernel & Uboot' 카테고리의 다른 글

linux logo 변경하기.  (0) 2012.10.08
u-boot home page  (0) 2012.08.17
Video for Linux Two API Specification  (0) 2012.05.29
sysfs 다루기  (0) 2011.11.15
S5PC100 FIMC와 S3C6410 FIMC와의 차이  (0) 2011.03.03

http://v4l2spec.bytesex.org/spec/

 

Video for Linux Two API Specification

Revision 0.24

Michael H Schimek

            
          

Bill Dirks

Hans Verkuil

Martin Rubli

This document is copyrighted © 1999-2008 by Bill Dirks, Michael H. Schimek, Hans Verkuil and Martin Rubli.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the appendix entitled "GNU Free Documentation License".

Programming examples can be used and distributed without restrictions.


Table of Contents
Introduction
1. Common API Elements
1.1. Opening and Closing Devices
1.1.1. Device Naming
1.1.2. Related Devices
1.1.3. Multiple Opens
1.1.4. Shared Data Streams
1.1.5. Functions
1.2. Querying Capabilities
1.3. Application Priority
1.4. Video Inputs and Outputs
1.5. Audio Inputs and Outputs
1.6. Tuners and Modulators
1.6.1. Tuners
1.6.2. Modulators
1.6.3. Radio Frequency
1.6.4. Satellite Receivers
1.7. Video Standards
1.8. User Controls
1.9. Extended Controls
1.9.1. Introduction
1.9.2. The Extended Control API
1.9.3. Enumerating Extended Controls
1.9.4. Creating Control Panels
1.9.5. MPEG Control Reference
1.9.6. Camera Control Reference
1.10. Data Formats
1.10.1. Data Format Negotiation
1.10.2. Image Format Enumeration
1.11. Image Cropping, Insertion and Scaling
1.11.1. Cropping Structures
1.11.2. Scaling Adjustments
1.11.3. Examples
1.12. Streaming Parameters
2. Image Formats
2.1. Standard Image Formats
2.2. Colorspaces
2.3. Indexed Format
2.4. RGB Formats
Packed RGB formats -- Packed RGB formats
V4L2_PIX_FMT_SBGGR8 ('BA81') -- Bayer RGB format
V4L2_PIX_FMT_SBGGR16 ('BA82') -- Bayer RGB format
2.5. YUV Formats
Packed YUV formats -- Packed YUV formats
V4L2_PIX_FMT_GREY ('GREY') -- Grey-scale image
V4L2_PIX_FMT_Y16 ('Y16 ') -- Grey-scale image
V4L2_PIX_FMT_YUYV ('YUYV') -- Packed format with ½ horizontal chroma resolution, also known as YUV 4:2:2
V4L2_PIX_FMT_UYVY ('UYVY') -- Variation of V4L2_PIX_FMT_YUYV with different order of samples in memory
V4L2_PIX_FMT_Y41P ('Y41P') -- Format with ¼ horizontal chroma resolution, also known as YUV 4:1:1
V4L2_PIX_FMT_YVU420 ('YV12'), V4L2_PIX_FMT_YUV420 ('YU12') -- Planar formats with ½ horizontal and vertical chroma resolution, also known as YUV 4:2:0
V4L2_PIX_FMT_YVU410 ('YVU9'), V4L2_PIX_FMT_YUV410 ('YUV9') -- Planar formats with ¼ horizontal and vertical chroma resolution, also known as YUV 4:1:0
V4L2_PIX_FMT_YUV422P ('422P') -- Format with ½ horizontal chroma resolution, also known as YUV 4:2:2. Planar layout as opposed to V4L2_PIX_FMT_YUYV
V4L2_PIX_FMT_YUV411P ('411P') -- Format with ¼ horizontal chroma resolution, also known as YUV 4:1:1. Planar layout as opposed to V4L2_PIX_FMT_Y41P
V4L2_PIX_FMT_NV12 ('NV12'), V4L2_PIX_FMT_NV21 ('NV21') -- Formats with ½ horizontal and vertical chroma resolution, also known as YUV 4:2:0. One luminance and one chrominance plane with alternating chroma samples as opposed to V4L2_PIX_FMT_YVU420
2.6. Compressed Formats
2.7. Reserved Format Identifiers
3. Input/Output
3.1. Read/Write
3.2. Streaming I/O (Memory Mapping)
3.3. Streaming I/O (User Pointers)
3.4. Asynchronous I/O
3.5. Buffers
3.5.1. Timecodes
3.6. Field Order
4. Interfaces
4.1. Video Capture Interface
4.1.1. Querying Capabilities
4.1.2. Supplemental Functions
4.1.3. Image Format Negotiation
4.1.4. Reading Images
4.2. Video Overlay Interface
4.2.1. Querying Capabilities
4.2.2. Supplemental Functions
4.2.3. Setup
4.2.4. Overlay Window
4.2.5. Enabling Overlay
4.3. Video Output Interface
4.3.1. Querying Capabilities
4.3.2. Supplemental Functions
4.3.3. Image Format Negotiation
4.3.4. Writing Images
4.4. Video Output Overlay Interface
4.4.1. Querying Capabilities
4.4.2. Framebuffer
4.4.3. Overlay Window and Scaling
4.4.4. Enabling Overlay
4.5. Codec Interface
4.6. Effect Devices Interface
4.7. Raw VBI Data Interface
4.7.1. Querying Capabilities
4.7.2. Supplemental Functions
4.7.3. Raw VBI Format Negotiation
4.7.4. Reading and writing VBI images
4.8. Sliced VBI Data Interface
4.8.1. Querying Capabilities
4.8.2. Supplemental Functions
4.8.3. Sliced VBI Format Negotiation
4.8.4. Reading and writing sliced VBI data
4.9. Teletext Interface
4.10. Radio Interface
4.10.1. Querying Capabilities
4.10.2. Supplemental Functions
4.10.3. Programming
4.11. RDS Interface
I. Function Reference
V4L2 close() -- Close a V4L2 device
V4L2 ioctl() -- Program a V4L2 device
ioctl VIDIOC_CROPCAP -- Information about the video cropping and scaling abilities
ioctl VIDIOC_DBG_G_REGISTER, VIDIOC_DBG_S_REGISTER -- Read or write hardware registers
ioctl VIDIOC_ENCODER_CMD, VIDIOC_TRY_ENCODER_CMD -- Execute an encoder command
ioctl VIDIOC_ENUMAUDIO -- Enumerate audio inputs
ioctl VIDIOC_ENUMAUDOUT -- Enumerate audio outputs
ioctl VIDIOC_ENUM_FMT -- Enumerate image formats
ioctl VIDIOC_ENUM_FRAMESIZES -- Enumerate frame sizes
ioctl VIDIOC_ENUM_FRAMEINTERVALS -- Enumerate frame intervals
ioctl VIDIOC_ENUMINPUT -- Enumerate video inputs
ioctl VIDIOC_ENUMOUTPUT -- Enumerate video outputs
ioctl VIDIOC_ENUMSTD -- Enumerate supported video standards
ioctl VIDIOC_G_AUDIO, VIDIOC_S_AUDIO -- Query or select the current audio input and its attributes
ioctl VIDIOC_G_AUDOUT, VIDIOC_S_AUDOUT -- Query or select the current audio output
ioctl VIDIOC_G_CHIP_IDENT -- Identify the chips on a TV card
ioctl VIDIOC_G_CROP, VIDIOC_S_CROP -- Get or set the current cropping rectangle
ioctl VIDIOC_G_CTRL, VIDIOC_S_CTRL -- Get or set the value of a control
ioctl VIDIOC_G_ENC_INDEX -- Get meta data about a compressed video stream
ioctl VIDIOC_G_EXT_CTRLS, VIDIOC_S_EXT_CTRLS, VIDIOC_TRY_EXT_CTRLS -- Get or set the value of several controls, try control values
ioctl VIDIOC_G_FBUF, VIDIOC_S_FBUF -- Get or set frame buffer overlay parameters
ioctl VIDIOC_G_FMT, VIDIOC_S_FMT, VIDIOC_TRY_FMT -- Get or set the data format, try a format
ioctl VIDIOC_G_FREQUENCY, VIDIOC_S_FREQUENCY -- Get or set tuner or modulator radio frequency
ioctl VIDIOC_G_INPUT, VIDIOC_S_INPUT -- Query or select the current video input
ioctl VIDIOC_G_JPEGCOMP, VIDIOC_S_JPEGCOMP -- 
ioctl VIDIOC_G_MODULATOR, VIDIOC_S_MODULATOR -- Get or set modulator attributes
ioctl VIDIOC_G_OUTPUT, VIDIOC_S_OUTPUT -- Query or select the current video output
ioctl VIDIOC_G_PARM, VIDIOC_S_PARM -- Get or set streaming parameters
ioctl VIDIOC_G_PRIORITY, VIDIOC_S_PRIORITY -- Query or request the access priority associated with a file descriptor
ioctl VIDIOC_G_SLICED_VBI_CAP -- Query sliced VBI capabilities
ioctl VIDIOC_G_STD, VIDIOC_S_STD -- Query or select the video standard of the current input
ioctl VIDIOC_G_TUNER, VIDIOC_S_TUNER -- Get or set tuner attributes
ioctl VIDIOC_LOG_STATUS -- Log driver status information
ioctl VIDIOC_OVERLAY -- Start or stop video overlay
ioctl VIDIOC_QBUF, VIDIOC_DQBUF -- Exchange a buffer with the driver
ioctl VIDIOC_QUERYBUF -- Query the status of a buffer
ioctl VIDIOC_QUERYCAP -- Query device capabilities
ioctl VIDIOC_QUERYCTRL, VIDIOC_QUERYMENU -- Enumerate controls and menu control items
ioctl VIDIOC_QUERYSTD -- Sense the video standard received by the current input
ioctl VIDIOC_REQBUFS -- Initiate Memory Mapping or User Pointer I/O
ioctl VIDIOC_STREAMON, VIDIOC_STREAMOFF -- Start or stop streaming I/O
V4L2 mmap() -- Map device memory into application address space
V4L2 munmap() -- Unmap device memory
V4L2 open() -- Open a V4L2 device
V4L2 poll() -- Wait for some event on a file descriptor
V4L2 read() -- Read from a V4L2 device
V4L2 select() -- Synchronous I/O multiplexing
V4L2 write() -- Write to a V4L2 device
5. V4L2 Driver Programming
6. Changes
6.1. Differences between V4L and V4L2
6.1.1. Opening and Closing Devices
6.1.2. Querying Capabilities
6.1.3. Video Sources
6.1.4. Tuning
6.1.5. Image Properties
6.1.6. Audio
6.1.7. Frame Buffer Overlay
6.1.8. Cropping
6.1.9. Reading Images, Memory Mapping
6.1.10. Reading Raw VBI Data
6.1.11. Miscellaneous
6.2. Changes of the V4L2 API
6.2.1. Early Versions
6.2.2. V4L2 Version 0.16 1999-01-31
6.2.3. V4L2 Version 0.18 1999-03-16
6.2.4. V4L2 Version 0.19 1999-06-05
6.2.5. V4L2 Version 0.20 (1999-09-10)
6.2.6. V4L2 Version 0.20 incremental changes
6.2.7. V4L2 Version 0.20 2000-11-23
6.2.8. V4L2 Version 0.20 2002-07-25
6.2.9. V4L2 in Linux 2.5.46, 2002-10
6.2.10. V4L2 2003-06-19
6.2.11. V4L2 2003-11-05
6.2.12. V4L2 in Linux 2.6.6, 2004-05-09
6.2.13. V4L2 in Linux 2.6.8
6.2.14. V4L2 spec erratum 2004-08-01
6.2.15. V4L2 in Linux 2.6.14
6.2.16. V4L2 in Linux 2.6.15
6.2.17. V4L2 spec erratum 2005-11-27
6.2.18. V4L2 spec erratum 2006-01-10
6.2.19. V4L2 spec erratum 2006-02-03
6.2.20. V4L2 spec erratum 2006-02-04
6.2.21. V4L2 in Linux 2.6.17
6.2.22. V4L2 spec erratum 2006-09-23 (Draft 0.15)
6.2.23. V4L2 in Linux 2.6.18
6.2.24. V4L2 in Linux 2.6.19
6.2.25. V4L2 spec erratum 2006-10-12 (Draft 0.17)
6.2.26. V4L2 in Linux 2.6.21
6.2.27. V4L2 in Linux 2.6.22
6.2.28. V4L2 in Linux 2.6.24
6.2.29. V4L2 in Linux 2.6.25
6.3. Relation of V4L2 to other Linux multimedia APIs
6.3.1. X Video Extension
6.3.2. Digital Video
6.3.3. Audio Interfaces
6.4. Experimental API Elements
6.5. Obsolete API Elements
A. Video For Linux Two Header File
B. Video Capture Example
C. GNU Free Documentation License
C.1. 0. PREAMBLE
C.2. 1. APPLICABILITY AND DEFINITIONS
C.3. 2. VERBATIM COPYING
C.4. 3. COPYING IN QUANTITY
C.5. 4. MODIFICATIONS
C.6. 5. COMBINING DOCUMENTS
C.7. 6. COLLECTIONS OF DOCUMENTS
C.8. 7. AGGREGATION WITH INDEPENDENT WORKS
C.9. 8. TRANSLATION
C.10. 9. TERMINATION
C.11. 10. FUTURE REVISIONS OF THIS LICENSE
C.12. Addendum
List of Types
References


'Kernel & Uboot' 카테고리의 다른 글

linux logo 변경하기.  (0) 2012.10.08
u-boot home page  (0) 2012.08.17
i2c probe함수 호출 및 dev i2c addr등록 방법  (0) 2012.07.15
sysfs 다루기  (0) 2011.11.15
S5PC100 FIMC와 S3C6410 FIMC와의 차이  (0) 2011.03.03
[펌] http://blog.naver.com/wassupnari/100105102485


linux kernel과 userspace간의 데이터 교환은 언제나 큰 이슈인데, 대부분 read/write system call로 데이터를 넘겨주고 받거나, 혹은 ioctl을 이용해 단순한 값등을 넘기고 device만의 특정 커맨드를 넘겨줄 수 있다. 더불어 procfs가 있는데 이것은 kernel에 보다 직접적으로 접근할 수 있는 방법으로써, kernel 혹은 driver단에서 직접 /proc 에 특정 node를 생성해서 userspace와 직접적으로 data 교환이 가능하다. 현재는, 이것이 여기에서 말하려 하는 sysfs로 발전되어 가는 과정이라고 하는데, 솔직히 그 히스토리는 관심이 없고. 워낙 역사공부를 좋아라 하는 편이 아니라. :)

2가지 방법이 있는데, 사용법만 간추려 정리해보면 다음과 같다.

1. device 구조체를 직접 이용해 생성하는 방법

주로 shell상에서 echo등을 이용해 간단한 값을 넣거나, 혹은 cat등으로 간단한 값을 읽어올때 사용하기 편하다.

  1. device_create_file(struct device *, struct device_attribute *)  
  2. device_remove_file(struct device *, struct device_attribute *)  

  1. static DEVICE_ATTR(_name, _mode, _show, _store)  
- _name : device 이름. 접두어로 dev_attr_ 이 붙는다.
- _mode : 권한. linux나 unix등에서 사용하는 권한설정 숫자값을 그대로 사용.
        4, 2, 1의 조합으로 이루어지는 그 숫자 말이다. 궁금한 분은 chmod를 뒤져볼것.
- _show : kernel에 userspace에게 값을 보여주는(넘겨주는) func 포인터
- _store : userspace에서 kernel로 값을 보여주는(넘겨주는) func 포인터

위 세가지로, struct device에 지정된 /sys 아래의 특정 device 디렉토리 아래에 sysfs node를 생성할 수 있다.

다음은 _show와 _store에 선언된 특정 func의 prototype 및 pseude code이다.
  1. static ssize_t xxxxx_store(struct device *, struct device_attribute *,  
  2.                         const char *buf, size_t count)  
  3. {  
  4.     u8 data;  
  5.   
  6.     scanf(buf, fmt, &data);  
  7.   
  8.     return count;  
  9. }  
  10.   
  11. static ssize_t xxxxx_show(struct device *, struct device_attribute *,  
  12.                         char *buf)  
  13. {  
  14.     int count;  
  15.     u8 data;  
  16.   
  17.     count += sprintf(buf, fmt, data);  
  18.   
  19.     return count;  
  20. }  
return 값으로 둘다 count를 넘겨주는데, xxxx_store는 kernel주체로 동작되기 때문에, userspace쪽에서 넘겨주는 값의 길이를 알 수 없으므로 count인자를 받아야 한다. 대신, _store는 값을 받아오는 쪽이라, 굳이 userspace쪽으로 넘겨줄 값을 생각해 줄 필요는 없다.

반대로, xxxx_show는 kernel주체로 동작되더라도, userspace쪽에서 보여주는 함수이니 count함수는 userspace쪽에서나 필요하다. 대신, 꼭 code 내부에서 buf에 write한 count값을 고려해서 return으로 넘겨주어야 한다.

2. 간접적으로 kobj 구조체를 이용해 생성하는 방법

kobj 를 이용하면, binary file등의 덩치큰 파일들을 직접 쓰고 읽을 수 있다. (솔직히 읽는 것은 문제가 있을 법도 한데, 테스트를 못해봐서 -.-) 따라서, device_attribute 구조체 대신, bin_attribute 구조체를 사용한다. 기본적 node 생성방법은 다음과 같다.

  1. sysfs_create_bin_file(struct kobject *, struct bin_attribute *)  
  2. sysfs_remove_bin_file(struct kobject *, struct bin_attribute *)  
  3.   
  4. static struct bin_attribute xxxx_attr = {  
  5.     .attr = {  
  6.         .name = "xxxx",  
  7.         .mode = S_IRWXUGO,  
  8.     },  
  9.     .size = MAX_BUF,  
  10.     .read = xxx_sysfs_read,  
  11.     .write = xxx_sysfs_write,  
  12.     .mmap = xxx_sysfs_mmap,  
  13. }  

device_attribute 와 마찬가지로, 권한 mode, read/write/mmap 함수의 func 포인터를 지정해준다. name은 그냥 지정해줄 수 있고(device_attribute에도 있는지는 모르겠음. 찾아봐야함.) 가장 크게 다른점은, buffring을 위해 한번에 가능한 MAX size를 지정해줘야 한다는 것이다. binary data이므로 용량이 큰 파일들을 주로 쓰기 편하게(device에 올릴 firmware 같은 것들) 만들어놓은 것인듯.

read와 write함수의 prototype은 다음과 같다.

  1. static ssize_t xxxx_sysfs_read(struct kobject *, struct bin_attribute *,  
  2.            char *buf, loff_t off, size_t size)  
  3. {  
  4.     int count;  
  5.     u8 data;  
  6.   
  7.     if (off >= MAX_BUF)  
  8.         return 0;  
  9.   
  10.     if (off + size > PAGE_SIZE)  
  11.         return 0;  
  12.   
  13.     count += sprintf(buf, fmt, data);  
  14.   
  15.     return count;      
  16. }  
  17.   
  18. static ssize_t xxxx_sysfs_write(struct kobject *, struct bin_attribute *,  
  19.            char *buf, loff_t off, size_t size)  
  20. {  
  21.     if (off == 0) {  
  22.         /* set the values, for the first time */  
  23.     }  
  24.   
  25.    return size;  
  26. }  
  27.   
  28. static ssize_t xxxx_sysfs_mmap(struct kobject *, struct bin_attribute *,  
  29.            struct vm_area_struct *vma)  
  30. {  
  31.     /* ? */  
  32. }  

여 기서 중요한 것은, buffering되는 MAX 값에 따라 여러번 위 함수들이 호출된다는 것인데, 특히 write에서 쓰고자 하는 file이나 data가 MAX_BUF보다 크게 되면 그 배수만큼 여러번 call된다. 따라서 그에 맞는 처리를 해주어야 한다. 그 부분은 알아서들 하시길 바라며 ... :-)


3. data 교환을 위한 내부의 local 변수 선언

device_create_file() 을 이용하든 sysfs_create_bin_file()을 이용하든, 두 경우 모두 device의 struct device * 구조체 포인터만 알고 있으면 쉽게 적용 가능하다. device_create_file()의 경우 인자로 직접 struct device * 를 받으니, device_create_file()을 call할때 직접 그 포인터를 넘겨주면 된다, sysfs_create_bin_file()의 경우는 인자로 struct kobject *를 받는데, 이것은 &(struct device).kobj 값을 넘겨주면 된다.

또 하나, device 구조체를 이용하는 방법에서는 read/write 함수에서 struct device * 를 인자로 받기 때문에, 그 device 구조체를 보유하고 있는 상위 buf구조체나 platformdata등을 구하면 된다. 일례로, i2c client framework의 경우, 다음과 같이 i2c_client 구조체를 얻어올 수 있다.

  1. static ssize_t xxxxx_store(struct device *dev, struct device_attribute *attr,  
  2.    const char *buf, size_t count)  
  3. {  
  4.     struct i2c_clinet *c = container_of(dev, struct i2c_client, dev);  
  5.     .............  
마 찬가지로, sysfs_create_bin_file()의 경우에는 인자로 struct kobject *를 받는다. 따라서 우선, struct device *를 구하고, 그것을이용해 다시 struct i2c_client *를 얻는다.

  1. static ssize_t xxxx_sysfs_read(struct kobject *, struct bin_attribute *,  
  2.            char *buf, loff_t off, size_t size)  
  3. {  
  4.     struct device *dev = container_of(kobj, struct device , kobj);  
  5.     struct i2c_client *c = container_of(dev, struct i2c_client, dev);  
  6.         ..................  

이런식으로 응용하시면 되겠다. 

출처 : http://suchman.tistory.com/

'Kernel & Uboot' 카테고리의 다른 글

linux logo 변경하기.  (0) 2012.10.08
u-boot home page  (0) 2012.08.17
i2c probe함수 호출 및 dev i2c addr등록 방법  (0) 2012.07.15
Video for Linux Two API Specification  (0) 2012.05.29
S5PC100 FIMC와 S3C6410 FIMC와의 차이  (0) 2011.03.03
삼성에서 나오는 AP들중 많이 쓰이고 있는 S3C6410과 인기몰이중인 S5PC100의 FIMC를 비교해보려고 합니다.

삼성의 AP에서는 Camera Interface를 FIMC - Fully Interactive Mobile Camera Interface 라고 합니다.

이 FIMC의 역할은 초기엔 Camera Interface에만 국한되어 있었습니다. ( 6410 )

하지만 최근에 오면서( C100 ) 그 기능이 Camera Interface만이 아니라 POST, Rotator 영역까지  확장되었습니다.

   6410 C100
 IP 갯수  1
 3
 Camera Interface  O  O
 Post Process  X  O
 Rotate  X  O


6410에는 Post Processor와 Rotator가 존재합니다. ( Rotator의 경우 C100에서도 존재. but FIMC의 것을 사용 )

C100에서는 이 Post Processor와 Rotator의 기능을 FIMC가 하도록 유도하였습니다.

그러기 위해 FIMC IP의 갯수도 3개로 늘렸고 ( 덕분에 동시에 여러 Port의 Camera Open도 가능해졌습니다. )

기능도 향상 시켰습니다.

C100부터는 FIMC가 더이상 Camera Interface만이 아닌 멀티 플레이어가 된것이죠.


예를 들어 6410에서 동영상을 Play한다고 했을 땐,

File을 읽어 디코딩 하고 이 디코딩 된 스트림을 Post Processor에게 넘겨서 후처리를 한 후

Rotation이 필요하다면 Rotator를 통해 회전을 시켜 Frame Buffer에 출력했습니다.

이렇다는 것은 디코딩 된 스트림이 후처리 된 후에 Rotate를 할 목적으로 하나의 메모리 공간을 따로 예약 해야 한다는 것이었습니다.

추가적인 메모리가 필요했던 것이죠.

이것을 C100 부터 FIMC에서 통합적으로 수행할 수 있게 되었고,

디코딩 된 스트림은 FIMC를 통해 원하는대로 후처리, 회전을 수행한 후 Frame Buffer로 출력되게 됩니다.

이것은 편리성과 효율성에서 향상되었다고 볼 수 있습니다. (물론 FIMC 드라이버를 만드는 입장에선 복잡하겠군요 :P )


ps. 이 Post Process, Rotate의 기능들은 VDE Driver에서 하고 있으므로.. 실사용하는 입장에서는 차이를 못느낄거에요 아마.... __)

'Kernel & Uboot' 카테고리의 다른 글

linux logo 변경하기.  (0) 2012.10.08
u-boot home page  (0) 2012.08.17
i2c probe함수 호출 및 dev i2c addr등록 방법  (0) 2012.07.15
Video for Linux Two API Specification  (0) 2012.05.29
sysfs 다루기  (0) 2011.11.15

+ Recent posts