Hans Verkuil | 1a0adaf | 2007-04-27 12:31:25 -0300 | [diff] [blame] | 1 | /* |
| 2 | gpio functions. |
| 3 | Merging GPIO support into driver: |
| 4 | Copyright (C) 2004 Chris Kennedy <c@groovy.org> |
| 5 | Copyright (C) 2005-2007 Hans Verkuil <hverkuil@xs4all.nl> |
| 6 | |
| 7 | This program is free software; you can redistribute it and/or modify |
| 8 | it under the terms of the GNU General Public License as published by |
| 9 | the Free Software Foundation; either version 2 of the License, or |
| 10 | (at your option) any later version. |
| 11 | |
| 12 | This program is distributed in the hope that it will be useful, |
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | GNU General Public License for more details. |
| 16 | |
| 17 | You should have received a copy of the GNU General Public License |
| 18 | along with this program; if not, write to the Free Software |
| 19 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 20 | */ |
| 21 | |
| 22 | #include "ivtv-driver.h" |
| 23 | #include "ivtv-cards.h" |
| 24 | #include "ivtv-gpio.h" |
Hans Verkuil | 0e614cd | 2007-12-21 21:33:36 -0300 | [diff] [blame] | 25 | #include "tuner-xc2028.h" |
Hans Verkuil | 1a0adaf | 2007-04-27 12:31:25 -0300 | [diff] [blame] | 26 | #include <media/tuner.h> |
| 27 | |
| 28 | /* |
| 29 | * GPIO assignment of Yuan MPG600/MPG160 |
| 30 | * |
| 31 | * bit 15 14 13 12 | 11 10 9 8 | 7 6 5 4 | 3 2 1 0 |
| 32 | * OUTPUT IN1 IN0 AM3 AM2 AM1 AM0 |
| 33 | * INPUT DM1 DM0 |
| 34 | * |
| 35 | * IN* : Input selection |
| 36 | * IN1 IN0 |
| 37 | * 1 1 N/A |
| 38 | * 1 0 Line |
| 39 | * 0 1 N/A |
| 40 | * 0 0 Tuner |
| 41 | * |
| 42 | * AM* : Audio Mode |
| 43 | * AM3 0: Normal 1: Mixed(Sub+Main channel) |
| 44 | * AM2 0: Subchannel 1: Main channel |
| 45 | * AM1 0: Stereo 1: Mono |
| 46 | * AM0 0: Normal 1: Mute |
| 47 | * |
| 48 | * DM* : Detected tuner audio Mode |
| 49 | * DM1 0: Stereo 1: Mono |
| 50 | * DM0 0: Multiplex 1: Normal |
| 51 | * |
| 52 | * GPIO Initial Settings |
| 53 | * MPG600 MPG160 |
| 54 | * DIR 0x3080 0x7080 |
| 55 | * OUTPUT 0x000C 0x400C |
| 56 | * |
| 57 | * Special thanks to Makoto Iguchi <iguchi@tahoo.org> and Mr. Anonymous |
| 58 | * for analyzing GPIO of MPG160. |
| 59 | * |
| 60 | ***************************************************************************** |
| 61 | * |
| 62 | * GPIO assignment of Avermedia M179 (per information direct from AVerMedia) |
| 63 | * |
| 64 | * bit 15 14 13 12 | 11 10 9 8 | 7 6 5 4 | 3 2 1 0 |
| 65 | * OUTPUT IN0 AM0 IN1 AM1 AM2 IN2 BR0 BR1 |
| 66 | * INPUT |
| 67 | * |
| 68 | * IN* : Input selection |
| 69 | * IN0 IN1 IN2 |
| 70 | * * 1 * Mute |
| 71 | * 0 0 0 Line-In |
| 72 | * 1 0 0 TV Tuner Audio |
| 73 | * 0 0 1 FM Audio |
| 74 | * 1 0 1 Mute |
| 75 | * |
| 76 | * AM* : Audio Mode |
| 77 | * AM0 AM1 AM2 |
| 78 | * 0 0 0 TV Tuner Audio: L_OUT=(L+R)/2, R_OUT=SAP |
| 79 | * 0 0 1 TV Tuner Audio: L_OUT=R_OUT=SAP (SAP) |
| 80 | * 0 1 0 TV Tuner Audio: L_OUT=L, R_OUT=R (stereo) |
| 81 | * 0 1 1 TV Tuner Audio: mute |
| 82 | * 1 * * TV Tuner Audio: L_OUT=R_OUT=(L+R)/2 (mono) |
| 83 | * |
| 84 | * BR* : Audio Sample Rate (BR stands for bitrate for some reason) |
| 85 | * BR0 BR1 |
| 86 | * 0 0 32 kHz |
| 87 | * 0 1 44.1 kHz |
| 88 | * 1 0 48 kHz |
| 89 | * |
| 90 | * DM* : Detected tuner audio Mode |
| 91 | * Unknown currently |
| 92 | * |
| 93 | * Special thanks to AVerMedia Technologies, Inc. and Jiun-Kuei Jung at |
| 94 | * AVerMedia for providing the GPIO information used to add support |
| 95 | * for the M179 cards. |
| 96 | */ |
| 97 | |
| 98 | /********************* GPIO stuffs *********************/ |
| 99 | |
| 100 | /* GPIO registers */ |
| 101 | #define IVTV_REG_GPIO_IN 0x9008 |
| 102 | #define IVTV_REG_GPIO_OUT 0x900c |
| 103 | #define IVTV_REG_GPIO_DIR 0x9020 |
| 104 | |
| 105 | void ivtv_reset_ir_gpio(struct ivtv *itv) |
| 106 | { |
| 107 | int curdir, curout; |
| 108 | |
| 109 | if (itv->card->type != IVTV_CARD_PVR_150) |
| 110 | return; |
| 111 | IVTV_DEBUG_INFO("Resetting PVR150 IR\n"); |
| 112 | curout = read_reg(IVTV_REG_GPIO_OUT); |
| 113 | curdir = read_reg(IVTV_REG_GPIO_DIR); |
| 114 | curdir |= 0x80; |
| 115 | write_reg(curdir, IVTV_REG_GPIO_DIR); |
| 116 | curout = (curout & ~0xF) | 1; |
| 117 | write_reg(curout, IVTV_REG_GPIO_OUT); |
| 118 | /* We could use something else for smaller time */ |
Robert P. J. Day | 97989ad | 2007-07-16 10:47:51 -0300 | [diff] [blame] | 119 | schedule_timeout_interruptible(msecs_to_jiffies(1)); |
Hans Verkuil | 1a0adaf | 2007-04-27 12:31:25 -0300 | [diff] [blame] | 120 | curout |= 2; |
| 121 | write_reg(curout, IVTV_REG_GPIO_OUT); |
| 122 | curdir &= ~0x80; |
| 123 | write_reg(curdir, IVTV_REG_GPIO_DIR); |
| 124 | } |
| 125 | |
Hans Verkuil | 0e614cd | 2007-12-21 21:33:36 -0300 | [diff] [blame] | 126 | /* Xceive tuner reset function */ |
Michael Krufky | d7cba04 | 2008-09-12 13:31:45 -0300 | [diff] [blame] | 127 | int ivtv_reset_tuner_gpio(void *dev, int component, int cmd, int value) |
Hans Verkuil | 0e614cd | 2007-12-21 21:33:36 -0300 | [diff] [blame] | 128 | { |
| 129 | struct i2c_algo_bit_data *algo = dev; |
| 130 | struct ivtv *itv = algo->data; |
Hans Verkuil | 136531d | 2008-04-26 14:16:18 -0300 | [diff] [blame] | 131 | u32 curout; |
Hans Verkuil | 0e614cd | 2007-12-21 21:33:36 -0300 | [diff] [blame] | 132 | |
| 133 | if (cmd != XC2028_TUNER_RESET) |
| 134 | return 0; |
| 135 | IVTV_DEBUG_INFO("Resetting tuner\n"); |
| 136 | curout = read_reg(IVTV_REG_GPIO_OUT); |
Hans Verkuil | 136531d | 2008-04-26 14:16:18 -0300 | [diff] [blame] | 137 | curout &= ~(1 << itv->card->xceive_pin); |
Hans Verkuil | 0e614cd | 2007-12-21 21:33:36 -0300 | [diff] [blame] | 138 | write_reg(curout, IVTV_REG_GPIO_OUT); |
| 139 | schedule_timeout_interruptible(msecs_to_jiffies(1)); |
| 140 | |
Hans Verkuil | 136531d | 2008-04-26 14:16:18 -0300 | [diff] [blame] | 141 | curout |= 1 << itv->card->xceive_pin; |
Hans Verkuil | 0e614cd | 2007-12-21 21:33:36 -0300 | [diff] [blame] | 142 | write_reg(curout, IVTV_REG_GPIO_OUT); |
| 143 | schedule_timeout_interruptible(msecs_to_jiffies(1)); |
| 144 | return 0; |
| 145 | } |
Hans Verkuil | 1a0adaf | 2007-04-27 12:31:25 -0300 | [diff] [blame] | 146 | |
Hans Verkuil | 67ec09f | 2008-11-29 19:38:23 -0300 | [diff] [blame] | 147 | static inline struct ivtv *sd_to_ivtv(struct v4l2_subdev *sd) |
Hans Verkuil | 1a0adaf | 2007-04-27 12:31:25 -0300 | [diff] [blame] | 148 | { |
Hans Verkuil | 67ec09f | 2008-11-29 19:38:23 -0300 | [diff] [blame] | 149 | return container_of(sd, struct ivtv, sd_gpio); |
Hans Verkuil | 1a0adaf | 2007-04-27 12:31:25 -0300 | [diff] [blame] | 150 | } |
| 151 | |
| 152 | static struct v4l2_queryctrl gpio_ctrl_mute = { |
| 153 | .id = V4L2_CID_AUDIO_MUTE, |
| 154 | .type = V4L2_CTRL_TYPE_BOOLEAN, |
| 155 | .name = "Mute", |
| 156 | .minimum = 0, |
| 157 | .maximum = 1, |
| 158 | .step = 1, |
| 159 | .default_value = 1, |
| 160 | .flags = 0, |
| 161 | }; |
| 162 | |
Hans Verkuil | 67ec09f | 2008-11-29 19:38:23 -0300 | [diff] [blame] | 163 | static int subdev_s_clock_freq(struct v4l2_subdev *sd, u32 freq) |
Hans Verkuil | 1a0adaf | 2007-04-27 12:31:25 -0300 | [diff] [blame] | 164 | { |
Hans Verkuil | 67ec09f | 2008-11-29 19:38:23 -0300 | [diff] [blame] | 165 | struct ivtv *itv = sd_to_ivtv(sd); |
Hans Verkuil | 1a0adaf | 2007-04-27 12:31:25 -0300 | [diff] [blame] | 166 | u16 mask, data; |
| 167 | |
Hans Verkuil | 67ec09f | 2008-11-29 19:38:23 -0300 | [diff] [blame] | 168 | mask = itv->card->gpio_audio_freq.mask; |
| 169 | switch (freq) { |
| 170 | case 32000: |
| 171 | data = itv->card->gpio_audio_freq.f32000; |
Hans Verkuil | 1a0adaf | 2007-04-27 12:31:25 -0300 | [diff] [blame] | 172 | break; |
Hans Verkuil | 67ec09f | 2008-11-29 19:38:23 -0300 | [diff] [blame] | 173 | case 44100: |
| 174 | data = itv->card->gpio_audio_freq.f44100; |
Hans Verkuil | 1a0adaf | 2007-04-27 12:31:25 -0300 | [diff] [blame] | 175 | break; |
Hans Verkuil | 67ec09f | 2008-11-29 19:38:23 -0300 | [diff] [blame] | 176 | case 48000: |
Hans Verkuil | 1a0adaf | 2007-04-27 12:31:25 -0300 | [diff] [blame] | 177 | default: |
Hans Verkuil | 67ec09f | 2008-11-29 19:38:23 -0300 | [diff] [blame] | 178 | data = itv->card->gpio_audio_freq.f48000; |
| 179 | break; |
Hans Verkuil | 1a0adaf | 2007-04-27 12:31:25 -0300 | [diff] [blame] | 180 | } |
| 181 | if (mask) |
| 182 | write_reg((read_reg(IVTV_REG_GPIO_OUT) & ~mask) | (data & mask), IVTV_REG_GPIO_OUT); |
| 183 | return 0; |
| 184 | } |
Hans Verkuil | 67ec09f | 2008-11-29 19:38:23 -0300 | [diff] [blame] | 185 | |
| 186 | static int subdev_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt) |
| 187 | { |
| 188 | struct ivtv *itv = sd_to_ivtv(sd); |
| 189 | u16 mask; |
| 190 | |
| 191 | mask = itv->card->gpio_audio_detect.mask; |
| 192 | if (mask == 0 || (read_reg(IVTV_REG_GPIO_IN) & mask)) |
| 193 | vt->rxsubchans = V4L2_TUNER_MODE_STEREO | |
| 194 | V4L2_TUNER_MODE_LANG1 | V4L2_TUNER_MODE_LANG2; |
| 195 | else |
| 196 | vt->rxsubchans = V4L2_TUNER_SUB_MONO; |
| 197 | return 0; |
| 198 | } |
| 199 | |
| 200 | static int subdev_s_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt) |
| 201 | { |
| 202 | struct ivtv *itv = sd_to_ivtv(sd); |
| 203 | u16 mask, data; |
| 204 | |
| 205 | mask = itv->card->gpio_audio_mode.mask; |
| 206 | switch (vt->audmode) { |
| 207 | case V4L2_TUNER_MODE_LANG1: |
| 208 | data = itv->card->gpio_audio_mode.lang1; |
| 209 | break; |
| 210 | case V4L2_TUNER_MODE_LANG2: |
| 211 | data = itv->card->gpio_audio_mode.lang2; |
| 212 | break; |
| 213 | case V4L2_TUNER_MODE_MONO: |
| 214 | data = itv->card->gpio_audio_mode.mono; |
| 215 | break; |
| 216 | case V4L2_TUNER_MODE_STEREO: |
| 217 | case V4L2_TUNER_MODE_LANG1_LANG2: |
| 218 | default: |
| 219 | data = itv->card->gpio_audio_mode.stereo; |
| 220 | break; |
| 221 | } |
| 222 | if (mask) |
| 223 | write_reg((read_reg(IVTV_REG_GPIO_OUT) & ~mask) | (data & mask), IVTV_REG_GPIO_OUT); |
| 224 | return 0; |
| 225 | } |
| 226 | |
| 227 | static int subdev_s_radio(struct v4l2_subdev *sd) |
| 228 | { |
| 229 | struct ivtv *itv = sd_to_ivtv(sd); |
| 230 | u16 mask, data; |
| 231 | |
| 232 | mask = itv->card->gpio_audio_input.mask; |
| 233 | data = itv->card->gpio_audio_input.radio; |
| 234 | if (mask) |
| 235 | write_reg((read_reg(IVTV_REG_GPIO_OUT) & ~mask) | (data & mask), IVTV_REG_GPIO_OUT); |
| 236 | return 0; |
| 237 | } |
| 238 | |
| 239 | static int subdev_s_std(struct v4l2_subdev *sd, v4l2_std_id std) |
| 240 | { |
| 241 | struct ivtv *itv = sd_to_ivtv(sd); |
| 242 | u16 mask, data; |
| 243 | |
| 244 | mask = itv->card->gpio_audio_input.mask; |
| 245 | data = itv->card->gpio_audio_input.tuner; |
| 246 | if (mask) |
| 247 | write_reg((read_reg(IVTV_REG_GPIO_OUT) & ~mask) | (data & mask), IVTV_REG_GPIO_OUT); |
| 248 | return 0; |
| 249 | } |
| 250 | |
Hans Verkuil | 5325b42 | 2009-04-02 11:26:22 -0300 | [diff] [blame] | 251 | static int subdev_s_audio_routing(struct v4l2_subdev *sd, |
| 252 | u32 input, u32 output, u32 config) |
Hans Verkuil | 67ec09f | 2008-11-29 19:38:23 -0300 | [diff] [blame] | 253 | { |
| 254 | struct ivtv *itv = sd_to_ivtv(sd); |
| 255 | u16 mask, data; |
| 256 | |
Hans Verkuil | 5325b42 | 2009-04-02 11:26:22 -0300 | [diff] [blame] | 257 | if (input > 2) |
Hans Verkuil | 67ec09f | 2008-11-29 19:38:23 -0300 | [diff] [blame] | 258 | return -EINVAL; |
| 259 | mask = itv->card->gpio_audio_input.mask; |
Hans Verkuil | 5325b42 | 2009-04-02 11:26:22 -0300 | [diff] [blame] | 260 | switch (input) { |
Hans Verkuil | 67ec09f | 2008-11-29 19:38:23 -0300 | [diff] [blame] | 261 | case 0: |
| 262 | data = itv->card->gpio_audio_input.tuner; |
| 263 | break; |
| 264 | case 1: |
| 265 | data = itv->card->gpio_audio_input.linein; |
| 266 | break; |
| 267 | case 2: |
| 268 | default: |
| 269 | data = itv->card->gpio_audio_input.radio; |
| 270 | break; |
| 271 | } |
| 272 | if (mask) |
| 273 | write_reg((read_reg(IVTV_REG_GPIO_OUT) & ~mask) | (data & mask), IVTV_REG_GPIO_OUT); |
| 274 | return 0; |
| 275 | } |
| 276 | |
| 277 | static int subdev_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl) |
| 278 | { |
| 279 | struct ivtv *itv = sd_to_ivtv(sd); |
| 280 | u16 mask, data; |
| 281 | |
| 282 | if (ctrl->id != V4L2_CID_AUDIO_MUTE) |
| 283 | return -EINVAL; |
| 284 | mask = itv->card->gpio_audio_mute.mask; |
| 285 | data = itv->card->gpio_audio_mute.mute; |
| 286 | ctrl->value = (read_reg(IVTV_REG_GPIO_OUT) & mask) == data; |
| 287 | return 0; |
| 288 | } |
| 289 | |
| 290 | static int subdev_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl) |
| 291 | { |
| 292 | struct ivtv *itv = sd_to_ivtv(sd); |
| 293 | u16 mask, data; |
| 294 | |
| 295 | if (ctrl->id != V4L2_CID_AUDIO_MUTE) |
| 296 | return -EINVAL; |
| 297 | mask = itv->card->gpio_audio_mute.mask; |
| 298 | data = ctrl->value ? itv->card->gpio_audio_mute.mute : 0; |
| 299 | if (mask) |
| 300 | write_reg((read_reg(IVTV_REG_GPIO_OUT) & ~mask) | (data & mask), IVTV_REG_GPIO_OUT); |
| 301 | return 0; |
| 302 | } |
| 303 | |
| 304 | static int subdev_queryctrl(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc) |
| 305 | { |
| 306 | if (qc->id != V4L2_CID_AUDIO_MUTE) |
| 307 | return -EINVAL; |
| 308 | *qc = gpio_ctrl_mute; |
| 309 | return 0; |
| 310 | } |
| 311 | |
| 312 | static int subdev_log_status(struct v4l2_subdev *sd) |
| 313 | { |
| 314 | struct ivtv *itv = sd_to_ivtv(sd); |
| 315 | |
| 316 | IVTV_INFO("GPIO status: DIR=0x%04x OUT=0x%04x IN=0x%04x\n", |
| 317 | read_reg(IVTV_REG_GPIO_DIR), read_reg(IVTV_REG_GPIO_OUT), |
| 318 | read_reg(IVTV_REG_GPIO_IN)); |
| 319 | return 0; |
| 320 | } |
| 321 | |
Hans Verkuil | 5325b42 | 2009-04-02 11:26:22 -0300 | [diff] [blame] | 322 | static int subdev_s_video_routing(struct v4l2_subdev *sd, |
| 323 | u32 input, u32 output, u32 config) |
Hans Verkuil | 67ec09f | 2008-11-29 19:38:23 -0300 | [diff] [blame] | 324 | { |
| 325 | struct ivtv *itv = sd_to_ivtv(sd); |
| 326 | u16 mask, data; |
| 327 | |
Hans Verkuil | 5325b42 | 2009-04-02 11:26:22 -0300 | [diff] [blame] | 328 | if (input > 2) /* 0:Tuner 1:Composite 2:S-Video */ |
Hans Verkuil | 67ec09f | 2008-11-29 19:38:23 -0300 | [diff] [blame] | 329 | return -EINVAL; |
| 330 | mask = itv->card->gpio_video_input.mask; |
Hans Verkuil | 5325b42 | 2009-04-02 11:26:22 -0300 | [diff] [blame] | 331 | if (input == 0) |
Hans Verkuil | 67ec09f | 2008-11-29 19:38:23 -0300 | [diff] [blame] | 332 | data = itv->card->gpio_video_input.tuner; |
Hans Verkuil | 5325b42 | 2009-04-02 11:26:22 -0300 | [diff] [blame] | 333 | else if (input == 1) |
Hans Verkuil | 67ec09f | 2008-11-29 19:38:23 -0300 | [diff] [blame] | 334 | data = itv->card->gpio_video_input.composite; |
| 335 | else |
| 336 | data = itv->card->gpio_video_input.svideo; |
| 337 | if (mask) |
| 338 | write_reg((read_reg(IVTV_REG_GPIO_OUT) & ~mask) | (data & mask), IVTV_REG_GPIO_OUT); |
| 339 | return 0; |
| 340 | } |
| 341 | |
| 342 | static const struct v4l2_subdev_core_ops subdev_core_ops = { |
| 343 | .log_status = subdev_log_status, |
| 344 | .g_ctrl = subdev_g_ctrl, |
| 345 | .s_ctrl = subdev_s_ctrl, |
| 346 | .queryctrl = subdev_queryctrl, |
Hans Verkuil | f41737e | 2009-04-01 03:52:39 -0300 | [diff] [blame] | 347 | .s_std = subdev_s_std, |
Hans Verkuil | 67ec09f | 2008-11-29 19:38:23 -0300 | [diff] [blame] | 348 | }; |
| 349 | |
| 350 | static const struct v4l2_subdev_tuner_ops subdev_tuner_ops = { |
Hans Verkuil | 67ec09f | 2008-11-29 19:38:23 -0300 | [diff] [blame] | 351 | .s_radio = subdev_s_radio, |
| 352 | .g_tuner = subdev_g_tuner, |
| 353 | .s_tuner = subdev_s_tuner, |
| 354 | }; |
| 355 | |
| 356 | static const struct v4l2_subdev_audio_ops subdev_audio_ops = { |
| 357 | .s_clock_freq = subdev_s_clock_freq, |
| 358 | .s_routing = subdev_s_audio_routing, |
| 359 | }; |
| 360 | |
| 361 | static const struct v4l2_subdev_video_ops subdev_video_ops = { |
| 362 | .s_routing = subdev_s_video_routing, |
| 363 | }; |
| 364 | |
| 365 | static const struct v4l2_subdev_ops subdev_ops = { |
| 366 | .core = &subdev_core_ops, |
| 367 | .tuner = &subdev_tuner_ops, |
| 368 | .audio = &subdev_audio_ops, |
| 369 | .video = &subdev_video_ops, |
| 370 | }; |
| 371 | |
| 372 | int ivtv_gpio_init(struct ivtv *itv) |
| 373 | { |
| 374 | u16 pin = 0; |
| 375 | |
| 376 | if (itv->card->xceive_pin) |
| 377 | pin = 1 << itv->card->xceive_pin; |
| 378 | |
| 379 | if ((itv->card->gpio_init.direction | pin) == 0) |
| 380 | return 0; |
| 381 | |
| 382 | IVTV_DEBUG_INFO("GPIO initial dir: %08x out: %08x\n", |
| 383 | read_reg(IVTV_REG_GPIO_DIR), read_reg(IVTV_REG_GPIO_OUT)); |
| 384 | |
| 385 | /* init output data then direction */ |
| 386 | write_reg(itv->card->gpio_init.initial_value | pin, IVTV_REG_GPIO_OUT); |
| 387 | write_reg(itv->card->gpio_init.direction | pin, IVTV_REG_GPIO_DIR); |
| 388 | v4l2_subdev_init(&itv->sd_gpio, &subdev_ops); |
Hans Verkuil | 8ac05ae | 2009-02-07 07:02:27 -0300 | [diff] [blame] | 389 | snprintf(itv->sd_gpio.name, sizeof(itv->sd_gpio.name), "%s-gpio", itv->v4l2_dev.name); |
Hans Verkuil | 67ec09f | 2008-11-29 19:38:23 -0300 | [diff] [blame] | 390 | itv->sd_gpio.grp_id = IVTV_HW_GPIO; |
Hans Verkuil | 8ac05ae | 2009-02-07 07:02:27 -0300 | [diff] [blame] | 391 | return v4l2_device_register_subdev(&itv->v4l2_dev, &itv->sd_gpio); |
Hans Verkuil | 67ec09f | 2008-11-29 19:38:23 -0300 | [diff] [blame] | 392 | } |