Ignore:
Timestamp:
Nov 27, 2011, 5:33:00 PM (8 years ago)
Author:
Gedare Bloom <gedare@…>
Branches:
4.11, master
Children:
e5a8020
Parents:
b8ee42c
Message:

2011-11-27 Sebastien Bourdeauducq <seb@…>

PR 1972/bsps

  • milkymist_video/milkymist_video.h, milkymist_video/video.c: Adds an ioctl to implement selection of composite on any connector, S-Video and Component sources on the Milkymist One.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/lm32/shared/milkymist_video/video.c

    rb8ee42c r267357a  
    268268}
    269269
     270static void set_format(int format)
     271{
     272  switch(format) {
     273    case VIDEO_FORMAT_CVBS6:
     274      write_reg(0x00, 0x00);
     275      write_reg(0xc3, 0x05);
     276      write_reg(0xc4, 0x80);
     277      break;
     278    case VIDEO_FORMAT_CVBS5:
     279      write_reg(0x00, 0x00);
     280      write_reg(0xc3, 0x0d);
     281      write_reg(0xc4, 0x80);
     282      break;
     283    case VIDEO_FORMAT_CVBS4:
     284      write_reg(0x00, 0x00);
     285      write_reg(0xc3, 0x04);
     286      write_reg(0xc4, 0x80);
     287      break;
     288    case VIDEO_FORMAT_SVIDEO:
     289      write_reg(0x00, 0x06);
     290      write_reg(0xc3, 0xd5);
     291      write_reg(0xc4, 0x80);
     292      break;
     293    case VIDEO_FORMAT_COMPONENT:
     294      write_reg(0x00, 0x09);
     295      write_reg(0xc3, 0x45);
     296      write_reg(0xc4, 0x8d);
     297      break;
     298  }
     299}
     300
    270301rtems_device_driver video_control(
    271302  rtems_device_major_number major,
     
    334365   
    335366    case VIDEO_SET_REGISTER:
    336       write_reg(((unsigned int )a & 0xffff0000) >> 16,
     367      write_reg(((unsigned int)a & 0xffff0000) >> 16,
    337368        (unsigned int)a & 0x0000ffff);
    338369      sc = RTEMS_SUCCESSFUL;
     
    340371    case VIDEO_GET_REGISTER:
    341372      *a = read_reg(*a);
     373      sc = RTEMS_SUCCESSFUL;
     374      break;
     375   
     376    case VIDEO_SET_FORMAT:
     377      set_format((int)a);
    342378      sc = RTEMS_SUCCESSFUL;
    343379      break;
Note: See TracChangeset for help on using the changeset viewer.