diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-06 21:32:12 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-06 21:32:12 -0500 |
| commit | 9e9bc9736756f25d6c47b4eba0ebf25b20a6f153 (patch) | |
| tree | 647240f479c5f23910c3e6194d1c35b6ba54d75e /include/media | |
| parent | 3c0cb7c31c206aaedb967e44b98442bbeb17a6c4 (diff) | |
| parent | e3c92215198cb6aa00ad38db2780faa6b72e0a3f (diff) | |
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (255 commits)
[media] radio-aimslab.c: Fix gcc 4.5+ bug
[media] cx25821: Fix compilation breakage due to BKL dependency
[media] v4l2-compat-ioctl32: fix compile warning
[media] zoran: fix compiler warning
[media] tda18218: fix compile warning
[media] ngene: fix compile warning
[media] DVB: IR support for TechnoTrend CT-3650
[media] cx23885, cimax2.c: Fix case of two CAM insertion irq
[media] ir-nec-decoder: fix repeat key issue
[media] staging: se401 depends on USB
[media] staging: usbvideo/vicam depends on USB
[media] soc_camera: Add the ability to bind regulators to soc_camedra devices
[media] V4L2: Add a v4l2-subdev (soc-camera) driver for OmniVision OV2640 sensor
[media] v4l: soc-camera: switch to .unlocked_ioctl
[media] v4l: ov772x: simplify pointer dereference
[media] ov9640: fix OmniVision OV9640 sensor driver's priv data retrieving
[media] ov9640: use macro to request OmniVision OV9640 sensor private data
[media] ivtv-i2c: Fix two warnings
[media] staging/lirc: Update lirc TODO files
[media] cx88: Remove the obsolete i2c_adapter.id field
...
Diffstat (limited to 'include/media')
| -rw-r--r-- | include/media/bt819.h | 5 | ||||
| -rw-r--r-- | include/media/cx2341x.h | 2 | ||||
| -rw-r--r-- | include/media/ir-common.h | 107 | ||||
| -rw-r--r-- | include/media/ir-core.h | 214 | ||||
| -rw-r--r-- | include/media/ir-kbd-i2c.h | 13 | ||||
| -rw-r--r-- | include/media/lirc_dev.h | 6 | ||||
| -rw-r--r-- | include/media/ovcamchip.h | 90 | ||||
| -rw-r--r-- | include/media/rc-core.h | 220 | ||||
| -rw-r--r-- | include/media/rc-map.h | 44 | ||||
| -rw-r--r-- | include/media/saa6588.h (renamed from include/media/rds.h) | 18 | ||||
| -rw-r--r-- | include/media/si4713.h | 3 | ||||
| -rw-r--r-- | include/media/soc_camera.h | 5 | ||||
| -rw-r--r-- | include/media/timb_radio.h | 1 | ||||
| -rw-r--r-- | include/media/timb_video.h | 33 | ||||
| -rw-r--r-- | include/media/v4l2-chip-ident.h | 1 | ||||
| -rw-r--r-- | include/media/v4l2-common.h | 6 | ||||
| -rw-r--r-- | include/media/v4l2-ctrls.h | 4 | ||||
| -rw-r--r-- | include/media/v4l2-ioctl.h | 22 | ||||
| -rw-r--r-- | include/media/videobuf-core.h | 8 |
19 files changed, 314 insertions, 488 deletions
diff --git a/include/media/bt819.h b/include/media/bt819.h index 38f666bde77a..8025f4bc2bb6 100644 --- a/include/media/bt819.h +++ b/include/media/bt819.h | |||
| @@ -26,7 +26,10 @@ | |||
| 26 | /* v4l2_device notifications. */ | 26 | /* v4l2_device notifications. */ |
| 27 | 27 | ||
| 28 | /* Needed to reset the FIFO buffer when changing the input | 28 | /* Needed to reset the FIFO buffer when changing the input |
| 29 | or the video standard. */ | 29 | or the video standard. |
| 30 | |||
| 31 | Note: these ioctls that internal to the kernel and are never called | ||
| 32 | from userspace. */ | ||
| 30 | #define BT819_FIFO_RESET_LOW _IO('b', 0) | 33 | #define BT819_FIFO_RESET_LOW _IO('b', 0) |
| 31 | #define BT819_FIFO_RESET_HIGH _IO('b', 1) | 34 | #define BT819_FIFO_RESET_HIGH _IO('b', 1) |
| 32 | 35 | ||
diff --git a/include/media/cx2341x.h b/include/media/cx2341x.h index 8d08ebfe20b7..9635eebaab09 100644 --- a/include/media/cx2341x.h +++ b/include/media/cx2341x.h | |||
| @@ -95,7 +95,7 @@ int cx2341x_update(void *priv, cx2341x_mbox_func func, | |||
| 95 | const struct cx2341x_mpeg_params *new); | 95 | const struct cx2341x_mpeg_params *new); |
| 96 | int cx2341x_ctrl_query(const struct cx2341x_mpeg_params *params, | 96 | int cx2341x_ctrl_query(const struct cx2341x_mpeg_params *params, |
| 97 | struct v4l2_queryctrl *qctrl); | 97 | struct v4l2_queryctrl *qctrl); |
| 98 | const char **cx2341x_ctrl_get_menu(const struct cx2341x_mpeg_params *p, u32 id); | 98 | const char * const *cx2341x_ctrl_get_menu(const struct cx2341x_mpeg_params *p, u32 id); |
| 99 | int cx2341x_ext_ctrls(struct cx2341x_mpeg_params *params, int busy, | 99 | int cx2341x_ext_ctrls(struct cx2341x_mpeg_params *params, int busy, |
| 100 | struct v4l2_ext_controls *ctrls, unsigned int cmd); | 100 | struct v4l2_ext_controls *ctrls, unsigned int cmd); |
| 101 | void cx2341x_fill_defaults(struct cx2341x_mpeg_params *p); | 101 | void cx2341x_fill_defaults(struct cx2341x_mpeg_params *p); |
diff --git a/include/media/ir-common.h b/include/media/ir-common.h deleted file mode 100644 index 528050e39ad9..000000000000 --- a/include/media/ir-common.h +++ /dev/null | |||
| @@ -1,107 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * | ||
| 3 | * some common structs and functions to handle infrared remotes via | ||
| 4 | * input layer ... | ||
| 5 | * | ||
| 6 | * (c) 2003 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs] | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License as published by | ||
| 10 | * the Free Software Foundation; either version 2 of the License, or | ||
| 11 | * (at your option) any later version. | ||
| 12 | * | ||
| 13 | * This program is distributed in the hope that it will be useful, | ||
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 16 | * GNU General Public License for more details. | ||
| 17 | * | ||
| 18 | * You should have received a copy of the GNU General Public License | ||
| 19 | * along with this program; if not, write to the Free Software | ||
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 21 | */ | ||
| 22 | |||
| 23 | #ifndef _IR_COMMON | ||
| 24 | #define _IR_COMMON | ||
| 25 | |||
| 26 | #include <linux/input.h> | ||
| 27 | #include <linux/workqueue.h> | ||
| 28 | #include <linux/interrupt.h> | ||
| 29 | #include <media/ir-core.h> | ||
| 30 | |||
| 31 | #define RC5_START(x) (((x)>>12)&3) | ||
| 32 | #define RC5_TOGGLE(x) (((x)>>11)&1) | ||
| 33 | #define RC5_ADDR(x) (((x)>>6)&31) | ||
| 34 | #define RC5_INSTR(x) ((x)&63) | ||
| 35 | |||
| 36 | struct ir_input_state { | ||
| 37 | /* configuration */ | ||
| 38 | u64 ir_type; | ||
| 39 | |||
| 40 | /* key info */ | ||
| 41 | u32 ir_key; /* ir scancode */ | ||
| 42 | u32 keycode; /* linux key code */ | ||
| 43 | int keypressed; /* current state */ | ||
| 44 | }; | ||
| 45 | |||
| 46 | /* this was saa7134_ir and bttv_ir, moved here for | ||
| 47 | * rc5 decoding. */ | ||
| 48 | struct card_ir { | ||
| 49 | struct input_dev *dev; | ||
| 50 | struct ir_input_state ir; | ||
| 51 | char name[32]; | ||
| 52 | char phys[32]; | ||
| 53 | int users; | ||
| 54 | |||
| 55 | u32 running:1; | ||
| 56 | struct ir_dev_props props; | ||
| 57 | |||
| 58 | /* Usual gpio signalling */ | ||
| 59 | |||
| 60 | u32 mask_keycode; | ||
| 61 | u32 mask_keydown; | ||
| 62 | u32 mask_keyup; | ||
| 63 | u32 polling; | ||
| 64 | u32 last_gpio; | ||
| 65 | int shift_by; | ||
| 66 | int start; // What should RC5_START() be | ||
| 67 | int addr; // What RC5_ADDR() should be. | ||
| 68 | int rc5_key_timeout; | ||
| 69 | int rc5_remote_gap; | ||
| 70 | struct work_struct work; | ||
| 71 | struct timer_list timer; | ||
| 72 | |||
| 73 | /* RC5 gpio */ | ||
| 74 | u32 rc5_gpio; | ||
| 75 | struct timer_list timer_end; /* timer_end for code completion */ | ||
| 76 | struct timer_list timer_keyup; /* timer_end for key release */ | ||
| 77 | u32 last_rc5; /* last good rc5 code */ | ||
| 78 | u32 last_bit; /* last raw bit seen */ | ||
| 79 | u32 code; /* raw code under construction */ | ||
| 80 | struct timeval base_time; /* time of last seen code */ | ||
| 81 | int active; /* building raw code */ | ||
| 82 | |||
| 83 | /* NEC decoding */ | ||
| 84 | u32 nec_gpio; | ||
| 85 | struct tasklet_struct tlet; | ||
| 86 | |||
| 87 | /* IR core raw decoding */ | ||
| 88 | u32 raw_decode; | ||
| 89 | }; | ||
| 90 | |||
| 91 | /* Routines from ir-functions.c */ | ||
| 92 | |||
| 93 | int ir_input_init(struct input_dev *dev, struct ir_input_state *ir, | ||
| 94 | const u64 ir_type); | ||
| 95 | void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir); | ||
| 96 | void ir_input_keydown(struct input_dev *dev, struct ir_input_state *ir, | ||
| 97 | u32 ir_key); | ||
| 98 | u32 ir_extract_bits(u32 data, u32 mask); | ||
| 99 | int ir_dump_samples(u32 *samples, int count); | ||
| 100 | int ir_decode_biphase(u32 *samples, int count, int low, int high); | ||
| 101 | int ir_decode_pulsedistance(u32 *samples, int count, int low, int high); | ||
| 102 | u32 ir_rc5_decode(unsigned int code); | ||
| 103 | |||
| 104 | void ir_rc5_timer_end(unsigned long data); | ||
| 105 | void ir_rc5_timer_keyup(unsigned long data); | ||
| 106 | |||
| 107 | #endif | ||
diff --git a/include/media/ir-core.h b/include/media/ir-core.h deleted file mode 100644 index 6dc37fae6606..000000000000 --- a/include/media/ir-core.h +++ /dev/null | |||
| @@ -1,214 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Remote Controller core header | ||
| 3 | * | ||
| 4 | * Copyright (C) 2009-2010 by Mauro Carvalho Chehab <mchehab@redhat.com> | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License as published by | ||
| 8 | * the Free Software Foundation version 2 of the License. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | */ | ||
| 15 | |||
| 16 | #ifndef _IR_CORE | ||
| 17 | #define _IR_CORE | ||
| 18 | |||
| 19 | #include <linux/spinlock.h> | ||
| 20 | #include <linux/kfifo.h> | ||
| 21 | #include <linux/time.h> | ||
| 22 | #include <linux/timer.h> | ||
| 23 | #include <media/rc-map.h> | ||
| 24 | |||
| 25 | extern int ir_core_debug; | ||
| 26 | #define IR_dprintk(level, fmt, arg...) if (ir_core_debug >= level) \ | ||
| 27 | printk(KERN_DEBUG "%s: " fmt , __func__, ## arg) | ||
| 28 | |||
| 29 | enum rc_driver_type { | ||
| 30 | RC_DRIVER_SCANCODE = 0, /* Driver or hardware generates a scancode */ | ||
| 31 | RC_DRIVER_IR_RAW, /* Needs a Infra-Red pulse/space decoder */ | ||
| 32 | }; | ||
| 33 | |||
| 34 | /** | ||
| 35 | * struct ir_dev_props - Allow caller drivers to set special properties | ||
| 36 | * @driver_type: specifies if the driver or hardware have already a decoder, | ||
| 37 | * or if it needs to use the IR raw event decoders to produce a scancode | ||
| 38 | * @allowed_protos: bitmask with the supported IR_TYPE_* protocols | ||
| 39 | * @scanmask: some hardware decoders are not capable of providing the full | ||
| 40 | * scancode to the application. As this is a hardware limit, we can't do | ||
| 41 | * anything with it. Yet, as the same keycode table can be used with other | ||
| 42 | * devices, a mask is provided to allow its usage. Drivers should generally | ||
| 43 | * leave this field in blank | ||
| 44 | * @timeout: optional time after which device stops sending data | ||
| 45 | * @min_timeout: minimum timeout supported by device | ||
| 46 | * @max_timeout: maximum timeout supported by device | ||
| 47 | * @rx_resolution : resolution (in ns) of input sampler | ||
| 48 | * @tx_resolution: resolution (in ns) of output sampler | ||
| 49 | * @priv: driver-specific data, to be used on the callbacks | ||
| 50 | * @change_protocol: allow changing the protocol used on hardware decoders | ||
| 51 | * @open: callback to allow drivers to enable polling/irq when IR input device | ||
| 52 | * is opened. | ||
| 53 | * @close: callback to allow drivers to disable polling/irq when IR input device | ||
| 54 | * is opened. | ||
| 55 | * @s_tx_mask: set transmitter mask (for devices with multiple tx outputs) | ||
| 56 | * @s_tx_carrier: set transmit carrier frequency | ||
| 57 | * @s_tx_duty_cycle: set transmit duty cycle (0% - 100%) | ||
| 58 | * @s_rx_carrier: inform driver about carrier it is expected to handle | ||
| 59 | * @tx_ir: transmit IR | ||
| 60 | * @s_idle: optional: enable/disable hardware idle mode, upon which, | ||
| 61 | device doesn't interrupt host until it sees IR pulses | ||
| 62 | * @s_learning_mode: enable wide band receiver used for learning | ||
| 63 | * @s_carrier_report: enable carrier reports | ||
| 64 | */ | ||
| 65 | struct ir_dev_props { | ||
| 66 | enum rc_driver_type driver_type; | ||
| 67 | unsigned long allowed_protos; | ||
| 68 | u32 scanmask; | ||
| 69 | |||
| 70 | u32 timeout; | ||
| 71 | u32 min_timeout; | ||
| 72 | u32 max_timeout; | ||
| 73 | |||
| 74 | u32 rx_resolution; | ||
| 75 | u32 tx_resolution; | ||
| 76 | |||
| 77 | void *priv; | ||
| 78 | int (*change_protocol)(void *priv, u64 ir_type); | ||
| 79 | int (*open)(void *priv); | ||
| 80 | void (*close)(void *priv); | ||
| 81 | int (*s_tx_mask)(void *priv, u32 mask); | ||
| 82 | int (*s_tx_carrier)(void *priv, u32 carrier); | ||
| 83 | int (*s_tx_duty_cycle)(void *priv, u32 duty_cycle); | ||
| 84 | int (*s_rx_carrier_range)(void *priv, u32 min, u32 max); | ||
| 85 | int (*tx_ir)(void *priv, int *txbuf, u32 n); | ||
| 86 | void (*s_idle)(void *priv, bool enable); | ||
| 87 | int (*s_learning_mode)(void *priv, int enable); | ||
| 88 | int (*s_carrier_report) (void *priv, int enable); | ||
| 89 | }; | ||
| 90 | |||
| 91 | struct ir_input_dev { | ||
| 92 | struct device dev; /* device */ | ||
| 93 | char *driver_name; /* Name of the driver module */ | ||
| 94 | struct ir_scancode_table rc_tab; /* scan/key table */ | ||
| 95 | unsigned long devno; /* device number */ | ||
| 96 | struct ir_dev_props *props; /* Device properties */ | ||
| 97 | struct ir_raw_event_ctrl *raw; /* for raw pulse/space events */ | ||
| 98 | struct input_dev *input_dev; /* the input device associated with this device */ | ||
| 99 | bool idle; | ||
| 100 | |||
| 101 | /* key info - needed by IR keycode handlers */ | ||
| 102 | spinlock_t keylock; /* protects the below members */ | ||
| 103 | bool keypressed; /* current state */ | ||
| 104 | unsigned long keyup_jiffies; /* when should the current keypress be released? */ | ||
| 105 | struct timer_list timer_keyup; /* timer for releasing a keypress */ | ||
| 106 | u32 last_keycode; /* keycode of last command */ | ||
| 107 | u32 last_scancode; /* scancode of last command */ | ||
| 108 | u8 last_toggle; /* toggle of last command */ | ||
| 109 | }; | ||
| 110 | |||
| 111 | enum raw_event_type { | ||
| 112 | IR_SPACE = (1 << 0), | ||
| 113 | IR_PULSE = (1 << 1), | ||
| 114 | IR_START_EVENT = (1 << 2), | ||
| 115 | IR_STOP_EVENT = (1 << 3), | ||
| 116 | }; | ||
| 117 | |||
| 118 | #define to_ir_input_dev(_attr) container_of(_attr, struct ir_input_dev, attr) | ||
| 119 | |||
| 120 | /* From ir-keytable.c */ | ||
| 121 | int __ir_input_register(struct input_dev *dev, | ||
| 122 | const struct ir_scancode_table *ir_codes, | ||
| 123 | struct ir_dev_props *props, | ||
| 124 | const char *driver_name); | ||
| 125 | |||
| 126 | static inline int ir_input_register(struct input_dev *dev, | ||
| 127 | const char *map_name, | ||
| 128 | struct ir_dev_props *props, | ||
| 129 | const char *driver_name) { | ||
| 130 | struct ir_scancode_table *ir_codes; | ||
| 131 | struct ir_input_dev *ir_dev; | ||
| 132 | int rc; | ||
| 133 | |||
| 134 | if (!map_name) | ||
| 135 | return -EINVAL; | ||
| 136 | |||
| 137 | ir_codes = get_rc_map(map_name); | ||
| 138 | if (!ir_codes) { | ||
| 139 | ir_codes = get_rc_map(RC_MAP_EMPTY); | ||
| 140 | |||
| 141 | if (!ir_codes) | ||
| 142 | return -EINVAL; | ||
| 143 | } | ||
| 144 | |||
| 145 | rc = __ir_input_register(dev, ir_codes, props, driver_name); | ||
| 146 | if (rc < 0) | ||
| 147 | return -EINVAL; | ||
| 148 | |||
| 149 | ir_dev = input_get_drvdata(dev); | ||
| 150 | |||
| 151 | if (!rc && ir_dev->props && ir_dev->props->change_protocol) | ||
| 152 | rc = ir_dev->props->change_protocol(ir_dev->props->priv, | ||
| 153 | ir_codes->ir_type); | ||
| 154 | |||
| 155 | return rc; | ||
| 156 | } | ||
| 157 | |||
| 158 | void ir_input_unregister(struct input_dev *input_dev); | ||
| 159 | |||
| 160 | void ir_repeat(struct input_dev *dev); | ||
| 161 | void ir_keydown(struct input_dev *dev, int scancode, u8 toggle); | ||
| 162 | void ir_keyup(struct ir_input_dev *ir); | ||
| 163 | u32 ir_g_keycode_from_table(struct input_dev *input_dev, u32 scancode); | ||
| 164 | |||
| 165 | /* From ir-raw-event.c */ | ||
| 166 | |||
| 167 | struct ir_raw_event { | ||
| 168 | union { | ||
| 169 | u32 duration; | ||
| 170 | |||
| 171 | struct { | ||
| 172 | u32 carrier; | ||
| 173 | u8 duty_cycle; | ||
| 174 | }; | ||
| 175 | }; | ||
| 176 | |||
| 177 | unsigned pulse:1; | ||
| 178 | unsigned reset:1; | ||
| 179 | unsigned timeout:1; | ||
| 180 | unsigned carrier_report:1; | ||
| 181 | }; | ||
| 182 | |||
| 183 | #define DEFINE_IR_RAW_EVENT(event) \ | ||
| 184 | struct ir_raw_event event = { \ | ||
| 185 | { .duration = 0 } , \ | ||
| 186 | .pulse = 0, \ | ||
| 187 | .reset = 0, \ | ||
| 188 | .timeout = 0, \ | ||
| 189 | .carrier_report = 0 } | ||
| 190 | |||
| 191 | static inline void init_ir_raw_event(struct ir_raw_event *ev) | ||
| 192 | { | ||
| 193 | memset(ev, 0, sizeof(*ev)); | ||
| 194 | } | ||
| 195 | |||
| 196 | #define IR_MAX_DURATION 0xFFFFFFFF /* a bit more than 4 seconds */ | ||
| 197 | |||
| 198 | void ir_raw_event_handle(struct input_dev *input_dev); | ||
| 199 | int ir_raw_event_store(struct input_dev *input_dev, struct ir_raw_event *ev); | ||
| 200 | int ir_raw_event_store_edge(struct input_dev *input_dev, enum raw_event_type type); | ||
| 201 | int ir_raw_event_store_with_filter(struct input_dev *input_dev, | ||
| 202 | struct ir_raw_event *ev); | ||
| 203 | void ir_raw_event_set_idle(struct input_dev *input_dev, bool idle); | ||
| 204 | |||
| 205 | static inline void ir_raw_event_reset(struct input_dev *input_dev) | ||
| 206 | { | ||
| 207 | DEFINE_IR_RAW_EVENT(ev); | ||
| 208 | ev.reset = true; | ||
| 209 | |||
| 210 | ir_raw_event_store(input_dev, &ev); | ||
| 211 | ir_raw_event_handle(input_dev); | ||
| 212 | } | ||
| 213 | |||
| 214 | #endif /* _IR_CORE */ | ||
diff --git a/include/media/ir-kbd-i2c.h b/include/media/ir-kbd-i2c.h index 557c676ab7dc..768aa77925cd 100644 --- a/include/media/ir-kbd-i2c.h +++ b/include/media/ir-kbd-i2c.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #ifndef _IR_I2C | 1 | #ifndef _IR_I2C |
| 2 | #define _IR_I2C | 2 | #define _IR_I2C |
| 3 | 3 | ||
| 4 | #include <media/ir-common.h> | 4 | #include <media/rc-core.h> |
| 5 | 5 | ||
| 6 | #define DEFAULT_POLLING_INTERVAL 100 /* ms */ | 6 | #define DEFAULT_POLLING_INTERVAL 100 /* ms */ |
| 7 | 7 | ||
| @@ -9,11 +9,9 @@ struct IR_i2c; | |||
| 9 | 9 | ||
| 10 | struct IR_i2c { | 10 | struct IR_i2c { |
| 11 | char *ir_codes; | 11 | char *ir_codes; |
| 12 | |||
| 13 | struct i2c_client *c; | 12 | struct i2c_client *c; |
| 14 | struct input_dev *input; | 13 | struct rc_dev *rc; |
| 15 | struct ir_input_state ir; | 14 | |
| 16 | u64 ir_type; | ||
| 17 | /* Used to avoid fast repeating */ | 15 | /* Used to avoid fast repeating */ |
| 18 | unsigned char old; | 16 | unsigned char old; |
| 19 | 17 | ||
| @@ -39,13 +37,16 @@ enum ir_kbd_get_key_fn { | |||
| 39 | struct IR_i2c_init_data { | 37 | struct IR_i2c_init_data { |
| 40 | char *ir_codes; | 38 | char *ir_codes; |
| 41 | const char *name; | 39 | const char *name; |
| 42 | u64 type; /* IR_TYPE_RC5, etc */ | 40 | u64 type; /* RC_TYPE_RC5, etc */ |
| 43 | u32 polling_interval; /* 0 means DEFAULT_POLLING_INTERVAL */ | 41 | u32 polling_interval; /* 0 means DEFAULT_POLLING_INTERVAL */ |
| 42 | |||
| 44 | /* | 43 | /* |
| 45 | * Specify either a function pointer or a value indicating one of | 44 | * Specify either a function pointer or a value indicating one of |
| 46 | * ir_kbd_i2c's internal get_key functions | 45 | * ir_kbd_i2c's internal get_key functions |
| 47 | */ | 46 | */ |
| 48 | int (*get_key)(struct IR_i2c*, u32*, u32*); | 47 | int (*get_key)(struct IR_i2c*, u32*, u32*); |
| 49 | enum ir_kbd_get_key_fn internal_get_key_func; | 48 | enum ir_kbd_get_key_fn internal_get_key_func; |
| 49 | |||
| 50 | struct rc_dev *rc_dev; | ||
| 50 | }; | 51 | }; |
| 51 | #endif | 52 | #endif |
diff --git a/include/media/lirc_dev.h b/include/media/lirc_dev.h index 54780a560d0e..630e702c9511 100644 --- a/include/media/lirc_dev.h +++ b/include/media/lirc_dev.h | |||
| @@ -217,9 +217,9 @@ int lirc_dev_fop_open(struct inode *inode, struct file *file); | |||
| 217 | int lirc_dev_fop_close(struct inode *inode, struct file *file); | 217 | int lirc_dev_fop_close(struct inode *inode, struct file *file); |
| 218 | unsigned int lirc_dev_fop_poll(struct file *file, poll_table *wait); | 218 | unsigned int lirc_dev_fop_poll(struct file *file, poll_table *wait); |
| 219 | long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg); | 219 | long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg); |
| 220 | ssize_t lirc_dev_fop_read(struct file *file, char *buffer, size_t length, | 220 | ssize_t lirc_dev_fop_read(struct file *file, char __user *buffer, size_t length, |
| 221 | loff_t *ppos); | 221 | loff_t *ppos); |
| 222 | ssize_t lirc_dev_fop_write(struct file *file, const char *buffer, size_t length, | 222 | ssize_t lirc_dev_fop_write(struct file *file, const char __user *buffer, |
| 223 | loff_t *ppos); | 223 | size_t length, loff_t *ppos); |
| 224 | 224 | ||
| 225 | #endif | 225 | #endif |
diff --git a/include/media/ovcamchip.h b/include/media/ovcamchip.h deleted file mode 100644 index 05b9569ef1c8..000000000000 --- a/include/media/ovcamchip.h +++ /dev/null | |||
| @@ -1,90 +0,0 @@ | |||
| 1 | /* OmniVision* camera chip driver API | ||
| 2 | * | ||
| 3 | * Copyright (c) 1999-2004 Mark McClelland | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License as published by the | ||
| 7 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 8 | * option) any later version. NO WARRANTY OF ANY KIND is expressed or implied. | ||
| 9 | * | ||
| 10 | * * OmniVision is a trademark of OmniVision Technologies, Inc. This driver | ||
| 11 | * is not sponsored or developed by them. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef __LINUX_OVCAMCHIP_H | ||
| 15 | #define __LINUX_OVCAMCHIP_H | ||
| 16 | |||
| 17 | #include <linux/videodev.h> | ||
| 18 | #include <media/v4l2-common.h> | ||
| 19 | |||
| 20 | /* --------------------------------- */ | ||
| 21 | /* ENUMERATIONS */ | ||
| 22 | /* --------------------------------- */ | ||
| 23 | |||
| 24 | /* Controls */ | ||
| 25 | enum { | ||
| 26 | OVCAMCHIP_CID_CONT, /* Contrast */ | ||
| 27 | OVCAMCHIP_CID_BRIGHT, /* Brightness */ | ||
| 28 | OVCAMCHIP_CID_SAT, /* Saturation */ | ||
| 29 | OVCAMCHIP_CID_HUE, /* Hue */ | ||
| 30 | OVCAMCHIP_CID_EXP, /* Exposure */ | ||
| 31 | OVCAMCHIP_CID_FREQ, /* Light frequency */ | ||
| 32 | OVCAMCHIP_CID_BANDFILT, /* Banding filter */ | ||
| 33 | OVCAMCHIP_CID_AUTOBRIGHT, /* Auto brightness */ | ||
| 34 | OVCAMCHIP_CID_AUTOEXP, /* Auto exposure */ | ||
| 35 | OVCAMCHIP_CID_BACKLIGHT, /* Back light compensation */ | ||
| 36 | OVCAMCHIP_CID_MIRROR, /* Mirror horizontally */ | ||
| 37 | }; | ||
| 38 | |||
| 39 | /* Chip types */ | ||
| 40 | #define NUM_CC_TYPES 9 | ||
| 41 | enum { | ||
| 42 | CC_UNKNOWN, | ||
| 43 | CC_OV76BE, | ||
| 44 | CC_OV7610, | ||
| 45 | CC_OV7620, | ||
| 46 | CC_OV7620AE, | ||
| 47 | CC_OV6620, | ||
| 48 | CC_OV6630, | ||
| 49 | CC_OV6630AE, | ||
| 50 | CC_OV6630AF, | ||
| 51 | }; | ||
| 52 | |||
| 53 | /* --------------------------------- */ | ||
| 54 | /* I2C ADDRESSES */ | ||
| 55 | /* --------------------------------- */ | ||
| 56 | |||
| 57 | #define OV7xx0_SID (0x42 >> 1) | ||
| 58 | #define OV6xx0_SID (0xC0 >> 1) | ||
| 59 | |||
| 60 | /* --------------------------------- */ | ||
| 61 | /* API */ | ||
| 62 | /* --------------------------------- */ | ||
| 63 | |||
| 64 | struct ovcamchip_control { | ||
| 65 | __u32 id; | ||
| 66 | __s32 value; | ||
| 67 | }; | ||
| 68 | |||
| 69 | struct ovcamchip_window { | ||
| 70 | int x; | ||
| 71 | int y; | ||
| 72 | int width; | ||
| 73 | int height; | ||
| 74 | int format; | ||
| 75 | int quarter; /* Scale width and height down 2x */ | ||
| 76 | |||
| 77 | /* This stuff will be removed eventually */ | ||
| 78 | int clockdiv; /* Clock divisor setting */ | ||
| 79 | }; | ||
| 80 | |||
| 81 | /* Commands */ | ||
| 82 | #define OVCAMCHIP_CMD_Q_SUBTYPE _IOR (0x88, 0x00, int) | ||
| 83 | #define OVCAMCHIP_CMD_INITIALIZE _IOW (0x88, 0x01, int) | ||
| 84 | /* You must call OVCAMCHIP_CMD_INITIALIZE before any of commands below! */ | ||
| 85 | #define OVCAMCHIP_CMD_S_CTRL _IOW (0x88, 0x02, struct ovcamchip_control) | ||
| 86 | #define OVCAMCHIP_CMD_G_CTRL _IOWR (0x88, 0x03, struct ovcamchip_control) | ||
| 87 | #define OVCAMCHIP_CMD_S_MODE _IOW (0x88, 0x04, struct ovcamchip_window) | ||
| 88 | #define OVCAMCHIP_MAX_CMD _IO (0x88, 0x3f) | ||
| 89 | |||
| 90 | #endif | ||
diff --git a/include/media/rc-core.h b/include/media/rc-core.h new file mode 100644 index 000000000000..a23c1fc685a1 --- /dev/null +++ b/include/media/rc-core.h | |||
| @@ -0,0 +1,220 @@ | |||
| 1 | /* | ||
| 2 | * Remote Controller core header | ||
| 3 | * | ||
| 4 | * Copyright (C) 2009-2010 by Mauro Carvalho Chehab <mchehab@redhat.com> | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License as published by | ||
| 8 | * the Free Software Foundation version 2 of the License. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | */ | ||
| 15 | |||
| 16 | #ifndef _RC_CORE | ||
| 17 | #define _RC_CORE | ||
| 18 | |||
| 19 | #include <linux/spinlock.h> | ||
| 20 | #include <linux/kfifo.h> | ||
| 21 | #include <linux/time.h> | ||
| 22 | #include <linux/timer.h> | ||
| 23 | #include <media/rc-map.h> | ||
| 24 | |||
| 25 | extern int rc_core_debug; | ||
| 26 | #define IR_dprintk(level, fmt, arg...) if (rc_core_debug >= level) \ | ||
| 27 | printk(KERN_DEBUG "%s: " fmt , __func__, ## arg) | ||
| 28 | |||
| 29 | enum rc_driver_type { | ||
| 30 | RC_DRIVER_SCANCODE = 0, /* Driver or hardware generates a scancode */ | ||
| 31 | RC_DRIVER_IR_RAW, /* Needs a Infra-Red pulse/space decoder */ | ||
| 32 | }; | ||
| 33 | |||
| 34 | /** | ||
| 35 | * struct rc_dev - represents a remote control device | ||
| 36 | * @dev: driver model's view of this device | ||
| 37 | * @input_name: name of the input child device | ||
| 38 | * @input_phys: physical path to the input child device | ||
| 39 | * @input_id: id of the input child device (struct input_id) | ||
| 40 | * @driver_name: name of the hardware driver which registered this device | ||
| 41 | * @map_name: name of the default keymap | ||
| 42 | * @rc_map: current scan/key table | ||
| 43 | * @devno: unique remote control device number | ||
| 44 | * @raw: additional data for raw pulse/space devices | ||
| 45 | * @input_dev: the input child device used to communicate events to userspace | ||
| 46 | * @driver_type: specifies if protocol decoding is done in hardware or software | ||
| 47 | * @idle: used to keep track of RX state | ||
| 48 | * @allowed_protos: bitmask with the supported RC_TYPE_* protocols | ||
| 49 | * @scanmask: some hardware decoders are not capable of providing the full | ||
| 50 | * scancode to the application. As this is a hardware limit, we can't do | ||
| 51 | * anything with it. Yet, as the same keycode table can be used with other | ||
| 52 | * devices, a mask is provided to allow its usage. Drivers should generally | ||
| 53 | * leave this field in blank | ||
| 54 | * @priv: driver-specific data | ||
| 55 | * @keylock: protects the remaining members of the struct | ||
| 56 | * @keypressed: whether a key is currently pressed | ||
| 57 | * @keyup_jiffies: time (in jiffies) when the current keypress should be released | ||
| 58 | * @timer_keyup: timer for releasing a keypress | ||
| 59 | * @last_keycode: keycode of last keypress | ||
| 60 | * @last_scancode: scancode of last keypress | ||
| 61 | * @last_toggle: toggle value of last command | ||
| 62 | * @timeout: optional time after which device stops sending data | ||
| 63 | * @min_timeout: minimum timeout supported by device | ||
| 64 | * @max_timeout: maximum timeout supported by device | ||
| 65 | * @rx_resolution : resolution (in ns) of input sampler | ||
| 66 | * @tx_resolution: resolution (in ns) of output sampler | ||
| 67 | * @change_protocol: allow changing the protocol used on hardware decoders | ||
| 68 | * @open: callback to allow drivers to enable polling/irq when IR input device | ||
| 69 | * is opened. | ||
| 70 | * @close: callback to allow drivers to disable polling/irq when IR input device | ||
| 71 | * is opened. | ||
| 72 | * @s_tx_mask: set transmitter mask (for devices with multiple tx outputs) | ||
| 73 | * @s_tx_carrier: set transmit carrier frequency | ||
| 74 | * @s_tx_duty_cycle: set transmit duty cycle (0% - 100%) | ||
| 75 | * @s_rx_carrier: inform driver about carrier it is expected to handle | ||
| 76 | * @tx_ir: transmit IR | ||
| 77 | * @s_idle: enable/disable hardware idle mode, upon which, | ||
| 78 | * device doesn't interrupt host until it sees IR pulses | ||
| 79 | * @s_learning_mode: enable wide band receiver used for learning | ||
| 80 | * @s_carrier_report: enable carrier reports | ||
| 81 | */ | ||
| 82 | struct rc_dev { | ||
| 83 | struct device dev; | ||
| 84 | const char *input_name; | ||
| 85 | const char *input_phys; | ||
| 86 | struct input_id input_id; | ||
| 87 | char *driver_name; | ||
| 88 | const char *map_name; | ||
| 89 | struct rc_map rc_map; | ||
| 90 | unsigned long devno; | ||
| 91 | struct ir_raw_event_ctrl *raw; | ||
| 92 | struct input_dev *input_dev; | ||
| 93 | enum rc_driver_type driver_type; | ||
| 94 | bool idle; | ||
| 95 | u64 allowed_protos; | ||
| 96 | u32 scanmask; | ||
| 97 | void *priv; | ||
| 98 | spinlock_t keylock; | ||
| 99 | bool keypressed; | ||
| 100 | unsigned long keyup_jiffies; | ||
| 101 | struct timer_list timer_keyup; | ||
| 102 | u32 last_keycode; | ||
| 103 | u32 last_scancode; | ||
| 104 | u8 last_toggle; | ||
| 105 | u32 timeout; | ||
| 106 | u32 min_timeout; | ||
| 107 | u32 max_timeout; | ||
| 108 | u32 rx_resolution; | ||
| 109 | u32 tx_resolution; | ||
| 110 | int (*change_protocol)(struct rc_dev *dev, u64 rc_type); | ||
| 111 | int (*open)(struct rc_dev *dev); | ||
| 112 | void (*close)(struct rc_dev *dev); | ||
| 113 | int (*s_tx_mask)(struct rc_dev *dev, u32 mask); | ||
| 114 | int (*s_tx_carrier)(struct rc_dev *dev, u32 carrier); | ||
| 115 | int (*s_tx_duty_cycle)(struct rc_dev *dev, u32 duty_cycle); | ||
| 116 | int (*s_rx_carrier_range)(struct rc_dev *dev, u32 min, u32 max); | ||
| 117 | int (*tx_ir)(struct rc_dev *dev, int *txbuf, u32 n); | ||
| 118 | void (*s_idle)(struct rc_dev *dev, bool enable); | ||
| 119 | int (*s_learning_mode)(struct rc_dev *dev, int enable); | ||
| 120 | int (*s_carrier_report) (struct rc_dev *dev, int enable); | ||
| 121 | }; | ||
| 122 | |||
| 123 | #define to_rc_dev(d) container_of(d, struct rc_dev, dev) | ||
| 124 | |||
| 125 | /* | ||
| 126 | * From rc-main.c | ||
| 127 | * Those functions can be used on any type of Remote Controller. They | ||
| 128 | * basically creates an input_dev and properly reports the device as a | ||
| 129 | * Remote Controller, at sys/class/rc. | ||
| 130 | */ | ||
| 131 | |||
| 132 | struct rc_dev *rc_allocate_device(void); | ||
| 133 | void rc_free_device(struct rc_dev *dev); | ||
| 134 | int rc_register_device(struct rc_dev *dev); | ||
| 135 | void rc_unregister_device(struct rc_dev *dev); | ||
| 136 | |||
| 137 | void rc_repeat(struct rc_dev *dev); | ||
| 138 | void rc_keydown(struct rc_dev *dev, int scancode, u8 toggle); | ||
| 139 | void rc_keydown_notimeout(struct rc_dev *dev, int scancode, u8 toggle); | ||
| 140 | void rc_keyup(struct rc_dev *dev); | ||
| 141 | u32 rc_g_keycode_from_table(struct rc_dev *dev, u32 scancode); | ||
| 142 | |||
| 143 | /* | ||
| 144 | * From rc-raw.c | ||
| 145 | * The Raw interface is specific to InfraRed. It may be a good idea to | ||
| 146 | * split it later into a separate header. | ||
| 147 | */ | ||
| 148 | |||
| 149 | enum raw_event_type { | ||
| 150 | IR_SPACE = (1 << 0), | ||
| 151 | IR_PULSE = (1 << 1), | ||
| 152 | IR_START_EVENT = (1 << 2), | ||
| 153 | IR_STOP_EVENT = (1 << 3), | ||
| 154 | }; | ||
| 155 | |||
| 156 | struct ir_raw_event { | ||
| 157 | union { | ||
| 158 | u32 duration; | ||
| 159 | |||
| 160 | struct { | ||
| 161 | u32 carrier; | ||
| 162 | u8 duty_cycle; | ||
| 163 | }; | ||
| 164 | }; | ||
| 165 | |||
| 166 | unsigned pulse:1; | ||
| 167 | unsigned reset:1; | ||
| 168 | unsigned timeout:1; | ||
| 169 | unsigned carrier_report:1; | ||
| 170 | }; | ||
| 171 | |||
| 172 | #define DEFINE_IR_RAW_EVENT(event) \ | ||
| 173 | struct ir_raw_event event = { \ | ||
| 174 | { .duration = 0 } , \ | ||
| 175 | .pulse = 0, \ | ||
| 176 | .reset = 0, \ | ||
| 177 | .timeout = 0, \ | ||
| 178 | .carrier_report = 0 } | ||
| 179 | |||
| 180 | static inline void init_ir_raw_event(struct ir_raw_event *ev) | ||
| 181 | { | ||
| 182 | memset(ev, 0, sizeof(*ev)); | ||
| 183 | } | ||
| 184 | |||
| 185 | #define IR_MAX_DURATION 0xFFFFFFFF /* a bit more than 4 seconds */ | ||
| 186 | |||
| 187 | void ir_raw_event_handle(struct rc_dev *dev); | ||
| 188 | int ir_raw_event_store(struct rc_dev *dev, struct ir_raw_event *ev); | ||
| 189 | int ir_raw_event_store_edge(struct rc_dev *dev, enum raw_event_type type); | ||
| 190 | int ir_raw_event_store_with_filter(struct rc_dev *dev, | ||
| 191 | struct ir_raw_event *ev); | ||
| 192 | void ir_raw_event_set_idle(struct rc_dev *dev, bool idle); | ||
| 193 | |||
| 194 | static inline void ir_raw_event_reset(struct rc_dev *dev) | ||
| 195 | { | ||
| 196 | DEFINE_IR_RAW_EVENT(ev); | ||
| 197 | ev.reset = true; | ||
| 198 | |||
| 199 | ir_raw_event_store(dev, &ev); | ||
| 200 | ir_raw_event_handle(dev); | ||
| 201 | } | ||
| 202 | |||
| 203 | /* extract mask bits out of data and pack them into the result */ | ||
| 204 | static inline u32 ir_extract_bits(u32 data, u32 mask) | ||
| 205 | { | ||
| 206 | u32 vbit = 1, value = 0; | ||
| 207 | |||
| 208 | do { | ||
| 209 | if (mask & 1) { | ||
| 210 | if (data & 1) | ||
| 211 | value |= vbit; | ||
| 212 | vbit <<= 1; | ||
| 213 | } | ||
| 214 | data >>= 1; | ||
| 215 | } while (mask >>= 1); | ||
| 216 | |||
| 217 | return value; | ||
| 218 | } | ||
| 219 | |||
| 220 | #endif /* _RC_CORE */ | ||
diff --git a/include/media/rc-map.h b/include/media/rc-map.h index e0f17edf38ed..ee9e2f747c76 100644 --- a/include/media/rc-map.h +++ b/include/media/rc-map.h | |||
| @@ -11,45 +11,45 @@ | |||
| 11 | 11 | ||
| 12 | #include <linux/input.h> | 12 | #include <linux/input.h> |
| 13 | 13 | ||
| 14 | #define IR_TYPE_UNKNOWN 0 | 14 | #define RC_TYPE_UNKNOWN 0 |
| 15 | #define IR_TYPE_RC5 (1 << 0) /* Philips RC5 protocol */ | 15 | #define RC_TYPE_RC5 (1 << 0) /* Philips RC5 protocol */ |
| 16 | #define IR_TYPE_NEC (1 << 1) | 16 | #define RC_TYPE_NEC (1 << 1) |
| 17 | #define IR_TYPE_RC6 (1 << 2) /* Philips RC6 protocol */ | 17 | #define RC_TYPE_RC6 (1 << 2) /* Philips RC6 protocol */ |
| 18 | #define IR_TYPE_JVC (1 << 3) /* JVC protocol */ | 18 | #define RC_TYPE_JVC (1 << 3) /* JVC protocol */ |
| 19 | #define IR_TYPE_SONY (1 << 4) /* Sony12/15/20 protocol */ | 19 | #define RC_TYPE_SONY (1 << 4) /* Sony12/15/20 protocol */ |
| 20 | #define IR_TYPE_RC5_SZ (1 << 5) /* RC5 variant used by Streamzap */ | 20 | #define RC_TYPE_RC5_SZ (1 << 5) /* RC5 variant used by Streamzap */ |
| 21 | #define IR_TYPE_LIRC (1 << 30) /* Pass raw IR to lirc userspace */ | 21 | #define RC_TYPE_LIRC (1 << 30) /* Pass raw IR to lirc userspace */ |
| 22 | #define IR_TYPE_OTHER (1u << 31) | 22 | #define RC_TYPE_OTHER (1u << 31) |
| 23 | 23 | ||
| 24 | #define IR_TYPE_ALL (IR_TYPE_RC5 | IR_TYPE_NEC | IR_TYPE_RC6 | \ | 24 | #define RC_TYPE_ALL (RC_TYPE_RC5 | RC_TYPE_NEC | RC_TYPE_RC6 | \ |
| 25 | IR_TYPE_JVC | IR_TYPE_SONY | IR_TYPE_LIRC | \ | 25 | RC_TYPE_JVC | RC_TYPE_SONY | RC_TYPE_LIRC | \ |
| 26 | IR_TYPE_RC5_SZ | IR_TYPE_OTHER) | 26 | RC_TYPE_RC5_SZ | RC_TYPE_OTHER) |
| 27 | 27 | ||
| 28 | struct ir_scancode { | 28 | struct rc_map_table { |
| 29 | u32 scancode; | 29 | u32 scancode; |
| 30 | u32 keycode; | 30 | u32 keycode; |
| 31 | }; | 31 | }; |
| 32 | 32 | ||
| 33 | struct ir_scancode_table { | 33 | struct rc_map { |
| 34 | struct ir_scancode *scan; | 34 | struct rc_map_table *scan; |
| 35 | unsigned int size; /* Max number of entries */ | 35 | unsigned int size; /* Max number of entries */ |
| 36 | unsigned int len; /* Used number of entries */ | 36 | unsigned int len; /* Used number of entries */ |
| 37 | unsigned int alloc; /* Size of *scan in bytes */ | 37 | unsigned int alloc; /* Size of *scan in bytes */ |
| 38 | u64 ir_type; | 38 | u64 rc_type; |
| 39 | const char *name; | 39 | const char *name; |
| 40 | spinlock_t lock; | 40 | spinlock_t lock; |
| 41 | }; | 41 | }; |
| 42 | 42 | ||
| 43 | struct rc_keymap { | 43 | struct rc_map_list { |
| 44 | struct list_head list; | 44 | struct list_head list; |
| 45 | struct ir_scancode_table map; | 45 | struct rc_map map; |
| 46 | }; | 46 | }; |
| 47 | 47 | ||
| 48 | /* Routines from rc-map.c */ | 48 | /* Routines from rc-map.c */ |
| 49 | 49 | ||
| 50 | int ir_register_map(struct rc_keymap *map); | 50 | int rc_map_register(struct rc_map_list *map); |
| 51 | void ir_unregister_map(struct rc_keymap *map); | 51 | void rc_map_unregister(struct rc_map_list *map); |
| 52 | struct ir_scancode_table *get_rc_map(const char *name); | 52 | struct rc_map *rc_map_get(const char *name); |
| 53 | void rc_map_init(void); | 53 | void rc_map_init(void); |
| 54 | 54 | ||
| 55 | /* Names of the several keytables defined in-kernel */ | 55 | /* Names of the several keytables defined in-kernel */ |
| @@ -119,6 +119,7 @@ void rc_map_init(void); | |||
| 119 | #define RC_MAP_PINNACLE_PCTV_HD "rc-pinnacle-pctv-hd" | 119 | #define RC_MAP_PINNACLE_PCTV_HD "rc-pinnacle-pctv-hd" |
| 120 | #define RC_MAP_PIXELVIEW_NEW "rc-pixelview-new" | 120 | #define RC_MAP_PIXELVIEW_NEW "rc-pixelview-new" |
| 121 | #define RC_MAP_PIXELVIEW "rc-pixelview" | 121 | #define RC_MAP_PIXELVIEW "rc-pixelview" |
| 122 | #define RC_MAP_PIXELVIEW_002T "rc-pixelview-002t" | ||
| 122 | #define RC_MAP_PIXELVIEW_MK12 "rc-pixelview-mk12" | 123 | #define RC_MAP_PIXELVIEW_MK12 "rc-pixelview-mk12" |
| 123 | #define RC_MAP_POWERCOLOR_REAL_ANGEL "rc-powercolor-real-angel" | 124 | #define RC_MAP_POWERCOLOR_REAL_ANGEL "rc-powercolor-real-angel" |
| 124 | #define RC_MAP_PROTEUS_2309 "rc-proteus-2309" | 125 | #define RC_MAP_PROTEUS_2309 "rc-proteus-2309" |
| @@ -137,6 +138,7 @@ void rc_map_init(void); | |||
| 137 | #define RC_MAP_TREKSTOR "rc-trekstor" | 138 | #define RC_MAP_TREKSTOR "rc-trekstor" |
| 138 | #define RC_MAP_TT_1500 "rc-tt-1500" | 139 | #define RC_MAP_TT_1500 "rc-tt-1500" |
| 139 | #define RC_MAP_TWINHAN_VP1027_DVBS "rc-twinhan1027" | 140 | #define RC_MAP_TWINHAN_VP1027_DVBS "rc-twinhan1027" |
| 141 | #define RC_MAP_VIDEOMATE_M1F "rc-videomate-m1f" | ||
| 140 | #define RC_MAP_VIDEOMATE_S350 "rc-videomate-s350" | 142 | #define RC_MAP_VIDEOMATE_S350 "rc-videomate-s350" |
| 141 | #define RC_MAP_VIDEOMATE_TV_PVR "rc-videomate-tv-pvr" | 143 | #define RC_MAP_VIDEOMATE_TV_PVR "rc-videomate-tv-pvr" |
| 142 | #define RC_MAP_WINFAST "rc-winfast" | 144 | #define RC_MAP_WINFAST "rc-winfast" |
diff --git a/include/media/rds.h b/include/media/saa6588.h index a89426667618..2c3c4420a4eb 100644 --- a/include/media/rds.h +++ b/include/media/saa6588.h | |||
| @@ -4,9 +4,6 @@ | |||
| 4 | saa6588.c and every driver (e.g. bttv-driver.c) that wants | 4 | saa6588.c and every driver (e.g. bttv-driver.c) that wants |
| 5 | to use the saa6588 module. | 5 | to use the saa6588 module. |
| 6 | 6 | ||
| 7 | Instead of having a separate rds.h, I'd prefer to include | ||
| 8 | this stuff in one of the already existing files like tuner.h | ||
| 9 | |||
| 10 | (c) 2005 by Hans J. Koch | 7 | (c) 2005 by Hans J. Koch |
| 11 | 8 | ||
| 12 | This program is free software; you can redistribute it and/or modify | 9 | This program is free software; you can redistribute it and/or modify |
| @@ -25,10 +22,10 @@ | |||
| 25 | 22 | ||
| 26 | */ | 23 | */ |
| 27 | 24 | ||
| 28 | #ifndef _RDS_H | 25 | #ifndef _SAA6588_H |
| 29 | #define _RDS_H | 26 | #define _SAA6588_H |
| 30 | 27 | ||
| 31 | struct rds_command { | 28 | struct saa6588_command { |
| 32 | unsigned int block_count; | 29 | unsigned int block_count; |
| 33 | int result; | 30 | int result; |
| 34 | unsigned char __user *buffer; | 31 | unsigned char __user *buffer; |
| @@ -36,9 +33,10 @@ struct rds_command { | |||
| 36 | poll_table *event_list; | 33 | poll_table *event_list; |
| 37 | }; | 34 | }; |
| 38 | 35 | ||
| 39 | #define RDS_CMD_OPEN _IOW('R',1,int) | 36 | /* These ioctls are internal to the kernel */ |
| 40 | #define RDS_CMD_CLOSE _IOW('R',2,int) | 37 | #define SAA6588_CMD_OPEN _IOW('R', 1, int) |
| 41 | #define RDS_CMD_READ _IOR('R',3,int) | 38 | #define SAA6588_CMD_CLOSE _IOW('R', 2, int) |
| 42 | #define RDS_CMD_POLL _IOR('R',4,int) | 39 | #define SAA6588_CMD_READ _IOR('R', 3, int) |
| 40 | #define SAA6588_CMD_POLL _IOR('R', 4, int) | ||
| 43 | 41 | ||
| 44 | #endif | 42 | #endif |
diff --git a/include/media/si4713.h b/include/media/si4713.h index 99850a54ed09..ed7353e8a982 100644 --- a/include/media/si4713.h +++ b/include/media/si4713.h | |||
| @@ -23,8 +23,7 @@ | |||
| 23 | * Platform dependent definition | 23 | * Platform dependent definition |
| 24 | */ | 24 | */ |
| 25 | struct si4713_platform_data { | 25 | struct si4713_platform_data { |
| 26 | /* Set power state, zero is off, non-zero is on. */ | 26 | int gpio_reset; /* < 0 if not used */ |
| 27 | int (*set_power)(int power); | ||
| 28 | }; | 27 | }; |
| 29 | 28 | ||
| 30 | /* | 29 | /* |
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index 86e3631764ef..9386db829fb7 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h | |||
| @@ -97,6 +97,7 @@ struct soc_camera_host_ops { | |||
| 97 | #define SOCAM_SENSOR_INVERT_DATA (1 << 4) | 97 | #define SOCAM_SENSOR_INVERT_DATA (1 << 4) |
| 98 | 98 | ||
| 99 | struct i2c_board_info; | 99 | struct i2c_board_info; |
| 100 | struct regulator_bulk_data; | ||
| 100 | 101 | ||
| 101 | struct soc_camera_link { | 102 | struct soc_camera_link { |
| 102 | /* Camera bus id, used to match a camera and a bus */ | 103 | /* Camera bus id, used to match a camera and a bus */ |
| @@ -108,6 +109,10 @@ struct soc_camera_link { | |||
| 108 | const char *module_name; | 109 | const char *module_name; |
| 109 | void *priv; | 110 | void *priv; |
| 110 | 111 | ||
| 112 | /* Optional regulators that have to be managed on power on/off events */ | ||
| 113 | struct regulator_bulk_data *regulators; | ||
| 114 | int num_regulators; | ||
| 115 | |||
| 111 | /* | 116 | /* |
| 112 | * For non-I2C devices platform platform has to provide methods to | 117 | * For non-I2C devices platform platform has to provide methods to |
| 113 | * add a device to the system and to remove | 118 | * add a device to the system and to remove |
diff --git a/include/media/timb_radio.h b/include/media/timb_radio.h index fcd32a3696ba..a59a84854dc1 100644 --- a/include/media/timb_radio.h +++ b/include/media/timb_radio.h | |||
| @@ -24,7 +24,6 @@ | |||
| 24 | struct timb_radio_platform_data { | 24 | struct timb_radio_platform_data { |
| 25 | int i2c_adapter; /* I2C adapter where the tuner and dsp are attached */ | 25 | int i2c_adapter; /* I2C adapter where the tuner and dsp are attached */ |
| 26 | struct { | 26 | struct { |
| 27 | const char *module_name; | ||
| 28 | struct i2c_board_info *info; | 27 | struct i2c_board_info *info; |
| 29 | } tuner; | 28 | } tuner; |
| 30 | struct { | 29 | struct { |
diff --git a/include/media/timb_video.h b/include/media/timb_video.h new file mode 100644 index 000000000000..70ae43970a49 --- /dev/null +++ b/include/media/timb_video.h | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | /* | ||
| 2 | * timb_video.h Platform struct for the Timberdale video driver | ||
| 3 | * Copyright (c) 2009-2010 Intel Corporation | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License version 2 as | ||
| 7 | * published by the Free Software Foundation. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope that it will be useful, | ||
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | * GNU General Public License for more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License | ||
| 15 | * along with this program; if not, write to the Free Software | ||
| 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 17 | */ | ||
| 18 | |||
| 19 | #ifndef _TIMB_VIDEO_ | ||
| 20 | #define _TIMB_VIDEO_ 1 | ||
| 21 | |||
| 22 | #include <linux/i2c.h> | ||
| 23 | |||
| 24 | struct timb_video_platform_data { | ||
| 25 | int dma_channel; | ||
| 26 | int i2c_adapter; /* The I2C adapter where the encoder is attached */ | ||
| 27 | struct { | ||
| 28 | const char *module_name; | ||
| 29 | struct i2c_board_info *info; | ||
| 30 | } encoder; | ||
| 31 | }; | ||
| 32 | |||
| 33 | #endif | ||
diff --git a/include/media/v4l2-chip-ident.h b/include/media/v4l2-chip-ident.h index 51e89f2267b8..44fe44ec9ea7 100644 --- a/include/media/v4l2-chip-ident.h +++ b/include/media/v4l2-chip-ident.h | |||
| @@ -74,6 +74,7 @@ enum { | |||
| 74 | V4L2_IDENT_SOI968 = 256, | 74 | V4L2_IDENT_SOI968 = 256, |
| 75 | V4L2_IDENT_OV9640 = 257, | 75 | V4L2_IDENT_OV9640 = 257, |
| 76 | V4L2_IDENT_OV6650 = 258, | 76 | V4L2_IDENT_OV6650 = 258, |
| 77 | V4L2_IDENT_OV2640 = 259, | ||
| 77 | 78 | ||
| 78 | /* module saa7146: reserved range 300-309 */ | 79 | /* module saa7146: reserved range 300-309 */ |
| 79 | V4L2_IDENT_SAA7146 = 300, | 80 | V4L2_IDENT_SAA7146 = 300, |
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h index 239125af3ea3..2d65b35cdab2 100644 --- a/include/media/v4l2-common.h +++ b/include/media/v4l2-common.h | |||
| @@ -98,12 +98,12 @@ int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority local); | |||
| 98 | /* Control helper functions */ | 98 | /* Control helper functions */ |
| 99 | 99 | ||
| 100 | int v4l2_ctrl_check(struct v4l2_ext_control *ctrl, struct v4l2_queryctrl *qctrl, | 100 | int v4l2_ctrl_check(struct v4l2_ext_control *ctrl, struct v4l2_queryctrl *qctrl, |
| 101 | const char **menu_items); | 101 | const char * const *menu_items); |
| 102 | const char *v4l2_ctrl_get_name(u32 id); | 102 | const char *v4l2_ctrl_get_name(u32 id); |
| 103 | const char **v4l2_ctrl_get_menu(u32 id); | 103 | const char * const *v4l2_ctrl_get_menu(u32 id); |
| 104 | int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 step, s32 def); | 104 | int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 step, s32 def); |
| 105 | int v4l2_ctrl_query_menu(struct v4l2_querymenu *qmenu, | 105 | int v4l2_ctrl_query_menu(struct v4l2_querymenu *qmenu, |
| 106 | struct v4l2_queryctrl *qctrl, const char **menu_items); | 106 | struct v4l2_queryctrl *qctrl, const char * const *menu_items); |
| 107 | #define V4L2_CTRL_MENU_IDS_END (0xffffffff) | 107 | #define V4L2_CTRL_MENU_IDS_END (0xffffffff) |
| 108 | int v4l2_ctrl_query_menu_valid_items(struct v4l2_querymenu *qmenu, const u32 *ids); | 108 | int v4l2_ctrl_query_menu_valid_items(struct v4l2_querymenu *qmenu, const u32 *ids); |
| 109 | 109 | ||
diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h index 9b7bea928a88..d69ab4aae032 100644 --- a/include/media/v4l2-ctrls.h +++ b/include/media/v4l2-ctrls.h | |||
| @@ -112,7 +112,7 @@ struct v4l2_ctrl { | |||
| 112 | u32 step; | 112 | u32 step; |
| 113 | u32 menu_skip_mask; | 113 | u32 menu_skip_mask; |
| 114 | }; | 114 | }; |
| 115 | const char **qmenu; | 115 | const char * const *qmenu; |
| 116 | unsigned long flags; | 116 | unsigned long flags; |
| 117 | union { | 117 | union { |
| 118 | s32 val; | 118 | s32 val; |
| @@ -202,7 +202,7 @@ struct v4l2_ctrl_config { | |||
| 202 | s32 def; | 202 | s32 def; |
| 203 | u32 flags; | 203 | u32 flags; |
| 204 | u32 menu_skip_mask; | 204 | u32 menu_skip_mask; |
| 205 | const char **qmenu; | 205 | const char * const *qmenu; |
| 206 | unsigned int is_private:1; | 206 | unsigned int is_private:1; |
| 207 | unsigned int is_volatile:1; | 207 | unsigned int is_volatile:1; |
| 208 | }; | 208 | }; |
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h index 06daa6e8e051..67df37542c68 100644 --- a/include/media/v4l2-ioctl.h +++ b/include/media/v4l2-ioctl.h | |||
| @@ -14,12 +14,7 @@ | |||
| 14 | #include <linux/device.h> | 14 | #include <linux/device.h> |
| 15 | #include <linux/mutex.h> | 15 | #include <linux/mutex.h> |
| 16 | #include <linux/compiler.h> /* need __user */ | 16 | #include <linux/compiler.h> /* need __user */ |
| 17 | #ifdef CONFIG_VIDEO_V4L1_COMPAT | ||
| 18 | #define __MIN_V4L1 | ||
| 19 | #include <linux/videodev.h> | ||
| 20 | #else | ||
| 21 | #include <linux/videodev2.h> | 17 | #include <linux/videodev2.h> |
| 22 | #endif | ||
| 23 | 18 | ||
| 24 | struct v4l2_fh; | 19 | struct v4l2_fh; |
| 25 | 20 | ||
| @@ -113,10 +108,6 @@ struct v4l2_ioctl_ops { | |||
| 113 | 108 | ||
| 114 | 109 | ||
| 115 | int (*vidioc_overlay) (struct file *file, void *fh, unsigned int i); | 110 | int (*vidioc_overlay) (struct file *file, void *fh, unsigned int i); |
| 116 | #ifdef CONFIG_VIDEO_V4L1_COMPAT | ||
| 117 | /* buffer type is struct vidio_mbuf * */ | ||
| 118 | int (*vidiocgmbuf) (struct file *file, void *fh, struct video_mbuf *p); | ||
| 119 | #endif | ||
| 120 | int (*vidioc_g_fbuf) (struct file *file, void *fh, | 111 | int (*vidioc_g_fbuf) (struct file *file, void *fh, |
| 121 | struct v4l2_framebuffer *a); | 112 | struct v4l2_framebuffer *a); |
| 122 | int (*vidioc_s_fbuf) (struct file *file, void *fh, | 113 | int (*vidioc_s_fbuf) (struct file *file, void *fh, |
| @@ -300,22 +291,15 @@ extern void v4l_printk_ioctl(unsigned int cmd); | |||
| 300 | extern const char *v4l2_field_names[]; | 291 | extern const char *v4l2_field_names[]; |
| 301 | extern const char *v4l2_type_names[]; | 292 | extern const char *v4l2_type_names[]; |
| 302 | 293 | ||
| 303 | /* Compatibility layer interface -- v4l1-compat module */ | ||
| 304 | typedef long (*v4l2_kioctl)(struct file *file, | ||
| 305 | unsigned int cmd, void *arg); | ||
| 306 | #ifdef CONFIG_VIDEO_V4L1_COMPAT | ||
| 307 | long v4l_compat_translate_ioctl(struct file *file, | ||
| 308 | int cmd, void *arg, v4l2_kioctl driver_ioctl); | ||
| 309 | #else | ||
| 310 | #define v4l_compat_translate_ioctl(file, cmd, arg, ioctl) (-EINVAL) | ||
| 311 | #endif | ||
| 312 | |||
| 313 | #ifdef CONFIG_COMPAT | 294 | #ifdef CONFIG_COMPAT |
| 314 | /* 32 Bits compatibility layer for 64 bits processors */ | 295 | /* 32 Bits compatibility layer for 64 bits processors */ |
| 315 | extern long v4l2_compat_ioctl32(struct file *file, unsigned int cmd, | 296 | extern long v4l2_compat_ioctl32(struct file *file, unsigned int cmd, |
| 316 | unsigned long arg); | 297 | unsigned long arg); |
| 317 | #endif | 298 | #endif |
| 318 | 299 | ||
| 300 | typedef long (*v4l2_kioctl)(struct file *file, | ||
| 301 | unsigned int cmd, void *arg); | ||
| 302 | |||
| 319 | /* Include support for obsoleted stuff */ | 303 | /* Include support for obsoleted stuff */ |
| 320 | extern long video_usercopy(struct file *file, unsigned int cmd, | 304 | extern long video_usercopy(struct file *file, unsigned int cmd, |
| 321 | unsigned long arg, v4l2_kioctl func); | 305 | unsigned long arg, v4l2_kioctl func); |
diff --git a/include/media/videobuf-core.h b/include/media/videobuf-core.h index 1d3835fc26be..90ed895e217d 100644 --- a/include/media/videobuf-core.h +++ b/include/media/videobuf-core.h | |||
| @@ -17,10 +17,6 @@ | |||
| 17 | #define _VIDEOBUF_CORE_H | 17 | #define _VIDEOBUF_CORE_H |
| 18 | 18 | ||
| 19 | #include <linux/poll.h> | 19 | #include <linux/poll.h> |
| 20 | #ifdef CONFIG_VIDEO_V4L1_COMPAT | ||
| 21 | #define __MIN_V4L1 | ||
| 22 | #include <linux/videodev.h> | ||
| 23 | #endif | ||
| 24 | #include <linux/videodev2.h> | 20 | #include <linux/videodev2.h> |
| 25 | 21 | ||
| 26 | #define UNSET (-1U) | 22 | #define UNSET (-1U) |
| @@ -212,10 +208,6 @@ int videobuf_qbuf(struct videobuf_queue *q, | |||
| 212 | struct v4l2_buffer *b); | 208 | struct v4l2_buffer *b); |
| 213 | int videobuf_dqbuf(struct videobuf_queue *q, | 209 | int videobuf_dqbuf(struct videobuf_queue *q, |
| 214 | struct v4l2_buffer *b, int nonblocking); | 210 | struct v4l2_buffer *b, int nonblocking); |
| 215 | #ifdef CONFIG_VIDEO_V4L1_COMPAT | ||
| 216 | int videobuf_cgmbuf(struct videobuf_queue *q, | ||
| 217 | struct video_mbuf *mbuf, int count); | ||
| 218 | #endif | ||
| 219 | int videobuf_streamon(struct videobuf_queue *q); | 211 | int videobuf_streamon(struct videobuf_queue *q); |
| 220 | int videobuf_streamoff(struct videobuf_queue *q); | 212 | int videobuf_streamoff(struct videobuf_queue *q); |
| 221 | 213 | ||
