Steven Toth | 265a651 | 2008-04-18 21:34:00 -0300 | [diff] [blame] | 1 | /* |
| 2 | * Driver for the Auvitek AU0828 USB bridge |
| 3 | * |
Steven Toth | 6d89761 | 2008-09-03 17:12:12 -0300 | [diff] [blame] | 4 | * Copyright (c) 2008 Steven Toth <stoth@linuxtv.org> |
Steven Toth | 265a651 | 2008-04-18 21:34:00 -0300 | [diff] [blame] | 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; either version 2 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * |
| 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., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 20 | */ |
| 21 | |
| 22 | #include <linux/usb.h> |
| 23 | #include <linux/i2c.h> |
| 24 | #include <linux/i2c-algo-bit.h> |
Steven Toth | 28930fa | 2008-03-29 19:53:07 -0300 | [diff] [blame] | 25 | #include <media/tveeprom.h> |
Steven Toth | 265a651 | 2008-04-18 21:34:00 -0300 | [diff] [blame] | 26 | |
Devin Heitmueller | 8b2f079 | 2009-03-11 03:00:40 -0300 | [diff] [blame] | 27 | /* Analog */ |
| 28 | #include <linux/videodev2.h> |
| 29 | #include <media/videobuf-vmalloc.h> |
Devin Heitmueller | b14667f | 2009-03-11 03:01:04 -0300 | [diff] [blame] | 30 | #include <media/v4l2-device.h> |
Hans Verkuil | e8c26f4 | 2013-02-15 08:55:41 -0300 | [diff] [blame] | 31 | #include <media/v4l2-ctrls.h> |
Hans Verkuil | 83b0942 | 2013-02-15 09:14:00 -0300 | [diff] [blame] | 32 | #include <media/v4l2-fh.h> |
Devin Heitmueller | 8b2f079 | 2009-03-11 03:00:40 -0300 | [diff] [blame] | 33 | |
Steven Toth | 265a651 | 2008-04-18 21:34:00 -0300 | [diff] [blame] | 34 | /* DVB */ |
| 35 | #include "demux.h" |
| 36 | #include "dmxdev.h" |
| 37 | #include "dvb_demux.h" |
| 38 | #include "dvb_frontend.h" |
| 39 | #include "dvb_net.h" |
| 40 | #include "dvbdev.h" |
| 41 | |
| 42 | #include "au0828-reg.h" |
| 43 | #include "au0828-cards.h" |
| 44 | |
| 45 | #define DRIVER_NAME "au0828" |
| 46 | #define URB_COUNT 16 |
Steven Toth | 265a651 | 2008-04-18 21:34:00 -0300 | [diff] [blame] | 47 | #define URB_BUFSIZE (0xe522) |
| 48 | |
Devin Heitmueller | 8b2f079 | 2009-03-11 03:00:40 -0300 | [diff] [blame] | 49 | /* Analog constants */ |
| 50 | #define NTSC_STD_W 720 |
| 51 | #define NTSC_STD_H 480 |
| 52 | |
| 53 | #define AU0828_INTERLACED_DEFAULT 1 |
| 54 | #define V4L2_CID_PRIVATE_SHARPNESS (V4L2_CID_PRIVATE_BASE + 0) |
| 55 | |
| 56 | /* Defination for AU0828 USB transfer */ |
| 57 | #define AU0828_MAX_ISO_BUFS 12 /* maybe resize this value in the future */ |
Devin Heitmueller | 83f859c | 2010-06-25 01:33:39 -0300 | [diff] [blame] | 58 | #define AU0828_ISO_PACKETS_PER_URB 128 |
Devin Heitmueller | 8b2f079 | 2009-03-11 03:00:40 -0300 | [diff] [blame] | 59 | |
| 60 | #define AU0828_MIN_BUF 4 |
| 61 | #define AU0828_DEF_BUF 8 |
| 62 | |
Devin Heitmueller | 8b2f079 | 2009-03-11 03:00:40 -0300 | [diff] [blame] | 63 | #define AU0828_MAX_INPUT 4 |
| 64 | |
Devin Heitmueller | 7f8eacd | 2010-05-29 17:18:45 -0300 | [diff] [blame] | 65 | /* au0828 resource types (used for res_get/res_lock etc */ |
| 66 | #define AU0828_RESOURCE_VIDEO 0x01 |
| 67 | #define AU0828_RESOURCE_VBI 0x02 |
| 68 | |
Devin Heitmueller | 8b2f079 | 2009-03-11 03:00:40 -0300 | [diff] [blame] | 69 | enum au0828_itype { |
Devin Heitmueller | 220be77 | 2009-03-11 03:01:01 -0300 | [diff] [blame] | 70 | AU0828_VMUX_UNDEFINED = 0, |
| 71 | AU0828_VMUX_COMPOSITE, |
Devin Heitmueller | 8b2f079 | 2009-03-11 03:00:40 -0300 | [diff] [blame] | 72 | AU0828_VMUX_SVIDEO, |
| 73 | AU0828_VMUX_CABLE, |
| 74 | AU0828_VMUX_TELEVISION, |
| 75 | AU0828_VMUX_DVB, |
| 76 | AU0828_VMUX_DEBUG |
| 77 | }; |
| 78 | |
| 79 | struct au0828_input { |
| 80 | enum au0828_itype type; |
| 81 | unsigned int vmux; |
| 82 | unsigned int amux; |
| 83 | void (*audio_setup) (void *priv, int enable); |
| 84 | }; |
| 85 | |
Steven Toth | 265a651 | 2008-04-18 21:34:00 -0300 | [diff] [blame] | 86 | struct au0828_board { |
| 87 | char *name; |
Devin Heitmueller | f1add5b | 2009-03-11 03:00:47 -0300 | [diff] [blame] | 88 | unsigned int tuner_type; |
| 89 | unsigned char tuner_addr; |
Devin Heitmueller | 16af6f5 | 2009-04-01 00:11:31 -0300 | [diff] [blame] | 90 | unsigned char i2c_clk_divider; |
Mauro Carvalho Chehab | 2fcfd31 | 2014-07-24 22:49:02 -0300 | [diff] [blame] | 91 | unsigned char has_ir_i2c:1; |
Devin Heitmueller | 8b2f079 | 2009-03-11 03:00:40 -0300 | [diff] [blame] | 92 | struct au0828_input input[AU0828_MAX_INPUT]; |
| 93 | |
Steven Toth | 265a651 | 2008-04-18 21:34:00 -0300 | [diff] [blame] | 94 | }; |
| 95 | |
| 96 | struct au0828_dvb { |
| 97 | struct mutex lock; |
| 98 | struct dvb_adapter adapter; |
| 99 | struct dvb_frontend *frontend; |
| 100 | struct dvb_demux demux; |
| 101 | struct dmxdev dmxdev; |
| 102 | struct dmx_frontend fe_hw; |
| 103 | struct dmx_frontend fe_mem; |
| 104 | struct dvb_net net; |
| 105 | int feeding; |
Tim Mester | 4609981 | 2014-01-07 01:29:24 -0300 | [diff] [blame] | 106 | int start_count; |
| 107 | int stop_count; |
Mauro Carvalho Chehab | f6fef86 | 2014-05-09 06:17:55 -0300 | [diff] [blame] | 108 | |
| 109 | int (*set_frontend)(struct dvb_frontend *fe); |
Steven Toth | 265a651 | 2008-04-18 21:34:00 -0300 | [diff] [blame] | 110 | }; |
| 111 | |
Devin Heitmueller | 8b2f079 | 2009-03-11 03:00:40 -0300 | [diff] [blame] | 112 | enum au0828_stream_state { |
| 113 | STREAM_OFF, |
| 114 | STREAM_INTERRUPT, |
| 115 | STREAM_ON |
| 116 | }; |
| 117 | |
Devin Heitmueller | f1add5b | 2009-03-11 03:00:47 -0300 | [diff] [blame] | 118 | #define AUVI_INPUT(nr) (dev->board.input[nr]) |
Devin Heitmueller | 8b2f079 | 2009-03-11 03:00:40 -0300 | [diff] [blame] | 119 | |
| 120 | /* device state */ |
| 121 | enum au0828_dev_state { |
| 122 | DEV_INITIALIZED = 0x01, |
| 123 | DEV_DISCONNECTED = 0x02, |
| 124 | DEV_MISCONFIGURED = 0x04 |
| 125 | }; |
| 126 | |
| 127 | struct au0828_fh { |
Hans Verkuil | 83b0942 | 2013-02-15 09:14:00 -0300 | [diff] [blame] | 128 | /* must be the first field of this struct! */ |
| 129 | struct v4l2_fh fh; |
| 130 | |
Devin Heitmueller | 8b2f079 | 2009-03-11 03:00:40 -0300 | [diff] [blame] | 131 | struct au0828_dev *dev; |
Devin Heitmueller | 7f8eacd | 2010-05-29 17:18:45 -0300 | [diff] [blame] | 132 | unsigned int resources; |
| 133 | |
Devin Heitmueller | 8b2f079 | 2009-03-11 03:00:40 -0300 | [diff] [blame] | 134 | struct videobuf_queue vb_vidq; |
Devin Heitmueller | 7f8eacd | 2010-05-29 17:18:45 -0300 | [diff] [blame] | 135 | struct videobuf_queue vb_vbiq; |
Devin Heitmueller | 8b2f079 | 2009-03-11 03:00:40 -0300 | [diff] [blame] | 136 | enum v4l2_buf_type type; |
| 137 | }; |
| 138 | |
| 139 | struct au0828_usb_isoc_ctl { |
| 140 | /* max packet size of isoc transaction */ |
| 141 | int max_pkt_size; |
| 142 | |
| 143 | /* number of allocated urbs */ |
| 144 | int num_bufs; |
| 145 | |
| 146 | /* urb for isoc transfers */ |
| 147 | struct urb **urb; |
| 148 | |
| 149 | /* transfer buffers for isoc transfer */ |
| 150 | char **transfer_buffer; |
| 151 | |
| 152 | /* Last buffer command and region */ |
| 153 | u8 cmd; |
| 154 | int pos, size, pktsize; |
| 155 | |
| 156 | /* Last field: ODD or EVEN? */ |
| 157 | int field; |
| 158 | |
| 159 | /* Stores incomplete commands */ |
| 160 | u32 tmp_buf; |
| 161 | int tmp_buf_len; |
| 162 | |
| 163 | /* Stores already requested buffers */ |
Devin Heitmueller | 7f8eacd | 2010-05-29 17:18:45 -0300 | [diff] [blame] | 164 | struct au0828_buffer *buf; |
| 165 | struct au0828_buffer *vbi_buf; |
Devin Heitmueller | 8b2f079 | 2009-03-11 03:00:40 -0300 | [diff] [blame] | 166 | |
| 167 | /* Stores the number of received fields */ |
| 168 | int nfields; |
| 169 | |
| 170 | /* isoc urb callback */ |
| 171 | int (*isoc_copy) (struct au0828_dev *dev, struct urb *urb); |
| 172 | |
| 173 | }; |
| 174 | |
| 175 | /* buffer for one video frame */ |
| 176 | struct au0828_buffer { |
| 177 | /* common v4l buffer stuff -- must be first */ |
| 178 | struct videobuf_buffer vb; |
| 179 | |
| 180 | struct list_head frame; |
| 181 | int top_field; |
| 182 | int receiving; |
| 183 | }; |
| 184 | |
| 185 | struct au0828_dmaqueue { |
| 186 | struct list_head active; |
| 187 | struct list_head queued; |
| 188 | |
| 189 | wait_queue_head_t wq; |
| 190 | |
| 191 | /* Counters to control buffer fill */ |
| 192 | int pos; |
| 193 | }; |
| 194 | |
Steven Toth | 265a651 | 2008-04-18 21:34:00 -0300 | [diff] [blame] | 195 | struct au0828_dev { |
| 196 | struct mutex mutex; |
| 197 | struct usb_device *usbdev; |
Devin Heitmueller | f1add5b | 2009-03-11 03:00:47 -0300 | [diff] [blame] | 198 | int boardnr; |
| 199 | struct au0828_board board; |
Steven Toth | 265a651 | 2008-04-18 21:34:00 -0300 | [diff] [blame] | 200 | u8 ctrlmsg[64]; |
| 201 | |
| 202 | /* I2C */ |
| 203 | struct i2c_adapter i2c_adap; |
Devin Heitmueller | b14667f | 2009-03-11 03:01:04 -0300 | [diff] [blame] | 204 | struct i2c_algorithm i2c_algo; |
Steven Toth | 265a651 | 2008-04-18 21:34:00 -0300 | [diff] [blame] | 205 | struct i2c_client i2c_client; |
| 206 | u32 i2c_rc; |
| 207 | |
| 208 | /* Digital */ |
| 209 | struct au0828_dvb dvb; |
Devin Heitmueller | 43f2ccc | 2012-08-06 22:46:53 -0300 | [diff] [blame] | 210 | struct work_struct restart_streaming; |
Steven Toth | 265a651 | 2008-04-18 21:34:00 -0300 | [diff] [blame] | 211 | |
Michael Krufky | 8a4e786 | 2012-12-04 11:30:00 -0300 | [diff] [blame] | 212 | #ifdef CONFIG_VIDEO_AU0828_V4L2 |
Devin Heitmueller | 8b2f079 | 2009-03-11 03:00:40 -0300 | [diff] [blame] | 213 | /* Analog */ |
Devin Heitmueller | b14667f | 2009-03-11 03:01:04 -0300 | [diff] [blame] | 214 | struct v4l2_device v4l2_dev; |
Hans Verkuil | e8c26f4 | 2013-02-15 08:55:41 -0300 | [diff] [blame] | 215 | struct v4l2_ctrl_handler v4l2_ctrl_hdl; |
Michael Krufky | 8a4e786 | 2012-12-04 11:30:00 -0300 | [diff] [blame] | 216 | #endif |
Mauro Carvalho Chehab | 2fcfd31 | 2014-07-24 22:49:02 -0300 | [diff] [blame] | 217 | #ifdef CONFIG_VIDEO_AU0828_RC |
| 218 | struct au0828_rc *ir; |
| 219 | #endif |
| 220 | |
Devin Heitmueller | 8b2f079 | 2009-03-11 03:00:40 -0300 | [diff] [blame] | 221 | int users; |
Devin Heitmueller | 7f8eacd | 2010-05-29 17:18:45 -0300 | [diff] [blame] | 222 | unsigned int resources; /* resources in use */ |
Devin Heitmueller | 8b2f079 | 2009-03-11 03:00:40 -0300 | [diff] [blame] | 223 | struct video_device *vdev; |
| 224 | struct video_device *vbi_dev; |
Devin Heitmueller | 6e04b7b | 2010-09-01 22:03:43 -0300 | [diff] [blame] | 225 | struct timer_list vid_timeout; |
Devin Heitmueller | 78ca500 | 2010-10-09 14:43:53 -0300 | [diff] [blame] | 226 | int vid_timeout_running; |
Devin Heitmueller | 6e04b7b | 2010-09-01 22:03:43 -0300 | [diff] [blame] | 227 | struct timer_list vbi_timeout; |
Devin Heitmueller | 78ca500 | 2010-10-09 14:43:53 -0300 | [diff] [blame] | 228 | int vbi_timeout_running; |
Devin Heitmueller | 8b2f079 | 2009-03-11 03:00:40 -0300 | [diff] [blame] | 229 | int width; |
| 230 | int height; |
Devin Heitmueller | 7f8eacd | 2010-05-29 17:18:45 -0300 | [diff] [blame] | 231 | int vbi_width; |
| 232 | int vbi_height; |
| 233 | u32 vbi_read; |
Hans Verkuil | 33b6b89 | 2013-02-15 09:22:37 -0300 | [diff] [blame] | 234 | v4l2_std_id std; |
Devin Heitmueller | 8b2f079 | 2009-03-11 03:00:40 -0300 | [diff] [blame] | 235 | u32 field_size; |
| 236 | u32 frame_size; |
| 237 | u32 bytesperline; |
| 238 | int type; |
| 239 | u8 ctrl_ainput; |
| 240 | __u8 isoc_in_endpointaddr; |
| 241 | u8 isoc_init_ok; |
| 242 | int greenscreen_detected; |
| 243 | unsigned int frame_count; |
| 244 | int ctrl_freq; |
| 245 | int input_type; |
Devin Heitmueller | c98bc03 | 2012-08-06 22:46:59 -0300 | [diff] [blame] | 246 | int std_set_in_tuner_core; |
Devin Heitmueller | 8b2f079 | 2009-03-11 03:00:40 -0300 | [diff] [blame] | 247 | unsigned int ctrl_input; |
| 248 | enum au0828_dev_state dev_state; |
| 249 | enum au0828_stream_state stream_state; |
| 250 | wait_queue_head_t open; |
| 251 | |
| 252 | struct mutex lock; |
| 253 | |
| 254 | /* Isoc control struct */ |
| 255 | struct au0828_dmaqueue vidq; |
Devin Heitmueller | 7f8eacd | 2010-05-29 17:18:45 -0300 | [diff] [blame] | 256 | struct au0828_dmaqueue vbiq; |
Devin Heitmueller | 8b2f079 | 2009-03-11 03:00:40 -0300 | [diff] [blame] | 257 | struct au0828_usb_isoc_ctl isoc_ctl; |
| 258 | spinlock_t slock; |
| 259 | |
| 260 | /* usb transfer */ |
| 261 | int alt; /* alternate */ |
| 262 | int max_pkt_size; /* max packet size of isoc transaction */ |
| 263 | int num_alt; /* Number of alternative settings */ |
| 264 | unsigned int *alt_max_pkt_size; /* array of wMaxPacketSize */ |
| 265 | struct urb *urb[AU0828_MAX_ISO_BUFS]; /* urb for isoc transfers */ |
| 266 | char *transfer_buffer[AU0828_MAX_ISO_BUFS];/* transfer buffers for isoc |
| 267 | transfer */ |
| 268 | |
Steven Toth | 265a651 | 2008-04-18 21:34:00 -0300 | [diff] [blame] | 269 | /* USB / URB Related */ |
| 270 | int urb_streaming; |
| 271 | struct urb *urbs[URB_COUNT]; |
Tim Mester | f251b3e | 2014-01-07 01:29:25 -0300 | [diff] [blame] | 272 | |
| 273 | /* Preallocated transfer digital transfer buffers */ |
| 274 | |
| 275 | char *dig_transfer_buffer[URB_COUNT]; |
Steven Toth | 265a651 | 2008-04-18 21:34:00 -0300 | [diff] [blame] | 276 | }; |
| 277 | |
| 278 | /* ----------------------------------------------------------- */ |
Mauro Carvalho Chehab | 18d73c5 | 2008-04-18 22:12:52 -0300 | [diff] [blame] | 279 | #define au0828_read(dev, reg) au0828_readreg(dev, reg) |
| 280 | #define au0828_write(dev, reg, value) au0828_writereg(dev, reg, value) |
| 281 | #define au0828_andor(dev, reg, mask, value) \ |
| 282 | au0828_writereg(dev, reg, \ |
| 283 | (au0828_readreg(dev, reg) & ~(mask)) | ((value) & (mask))) |
Steven Toth | 265a651 | 2008-04-18 21:34:00 -0300 | [diff] [blame] | 284 | |
Mauro Carvalho Chehab | 18d73c5 | 2008-04-18 22:12:52 -0300 | [diff] [blame] | 285 | #define au0828_set(dev, reg, bit) au0828_andor(dev, (reg), (bit), (bit)) |
| 286 | #define au0828_clear(dev, reg, bit) au0828_andor(dev, (reg), (bit), 0) |
Steven Toth | 265a651 | 2008-04-18 21:34:00 -0300 | [diff] [blame] | 287 | |
| 288 | /* ----------------------------------------------------------- */ |
| 289 | /* au0828-core.c */ |
| 290 | extern u32 au0828_read(struct au0828_dev *dev, u16 reg); |
| 291 | extern u32 au0828_write(struct au0828_dev *dev, u16 reg, u32 val); |
Adrian Bunk | b33d24c | 2008-04-25 19:06:03 -0300 | [diff] [blame] | 292 | extern int au0828_debug; |
Steven Toth | 265a651 | 2008-04-18 21:34:00 -0300 | [diff] [blame] | 293 | |
| 294 | /* ----------------------------------------------------------- */ |
| 295 | /* au0828-cards.c */ |
| 296 | extern struct au0828_board au0828_boards[]; |
| 297 | extern struct usb_device_id au0828_usb_id_table[]; |
Steven Toth | 265a651 | 2008-04-18 21:34:00 -0300 | [diff] [blame] | 298 | extern void au0828_gpio_setup(struct au0828_dev *dev); |
Michael Krufky | d7cba04 | 2008-09-12 13:31:45 -0300 | [diff] [blame] | 299 | extern int au0828_tuner_callback(void *priv, int component, |
| 300 | int command, int arg); |
Steven Toth | 28930fa | 2008-03-29 19:53:07 -0300 | [diff] [blame] | 301 | extern void au0828_card_setup(struct au0828_dev *dev); |
Steven Toth | 265a651 | 2008-04-18 21:34:00 -0300 | [diff] [blame] | 302 | |
| 303 | /* ----------------------------------------------------------- */ |
| 304 | /* au0828-i2c.c */ |
| 305 | extern int au0828_i2c_register(struct au0828_dev *dev); |
| 306 | extern int au0828_i2c_unregister(struct au0828_dev *dev); |
Steven Toth | 265a651 | 2008-04-18 21:34:00 -0300 | [diff] [blame] | 307 | |
| 308 | /* ----------------------------------------------------------- */ |
Devin Heitmueller | 8b2f079 | 2009-03-11 03:00:40 -0300 | [diff] [blame] | 309 | /* au0828-video.c */ |
Devin Heitmueller | fc4ce6c | 2009-03-11 03:01:00 -0300 | [diff] [blame] | 310 | int au0828_analog_register(struct au0828_dev *dev, |
| 311 | struct usb_interface *interface); |
Devin Heitmueller | 8b2f079 | 2009-03-11 03:00:40 -0300 | [diff] [blame] | 312 | int au0828_analog_stream_disable(struct au0828_dev *d); |
| 313 | void au0828_analog_unregister(struct au0828_dev *dev); |
| 314 | |
| 315 | /* ----------------------------------------------------------- */ |
Steven Toth | 265a651 | 2008-04-18 21:34:00 -0300 | [diff] [blame] | 316 | /* au0828-dvb.c */ |
| 317 | extern int au0828_dvb_register(struct au0828_dev *dev); |
| 318 | extern void au0828_dvb_unregister(struct au0828_dev *dev); |
Mauro Carvalho Chehab | b799de7 | 2014-08-09 21:47:13 -0300 | [diff] [blame^] | 319 | void au0828_dvb_suspend(struct au0828_dev *dev); |
| 320 | void au0828_dvb_resume(struct au0828_dev *dev); |
Steven Toth | bc3c613 | 2008-04-18 21:39:11 -0300 | [diff] [blame] | 321 | |
Devin Heitmueller | 7f8eacd | 2010-05-29 17:18:45 -0300 | [diff] [blame] | 322 | /* au0828-vbi.c */ |
| 323 | extern struct videobuf_queue_ops au0828_vbi_qops; |
| 324 | |
Steven Toth | bc3c613 | 2008-04-18 21:39:11 -0300 | [diff] [blame] | 325 | #define dprintk(level, fmt, arg...)\ |
Adrian Bunk | b33d24c | 2008-04-25 19:06:03 -0300 | [diff] [blame] | 326 | do { if (au0828_debug & level)\ |
Steven Toth | bc3c613 | 2008-04-18 21:39:11 -0300 | [diff] [blame] | 327 | printk(KERN_DEBUG DRIVER_NAME "/0: " fmt, ## arg);\ |
| 328 | } while (0) |
Mauro Carvalho Chehab | 2fcfd31 | 2014-07-24 22:49:02 -0300 | [diff] [blame] | 329 | |
| 330 | /* au0828-input.c */ |
Shuah Khan | 917cbcd | 2014-08-08 21:36:18 -0300 | [diff] [blame] | 331 | #ifdef CONFIG_VIDEO_AU0828_RC |
| 332 | extern int au0828_rc_register(struct au0828_dev *dev); |
| 333 | extern void au0828_rc_unregister(struct au0828_dev *dev); |
| 334 | extern int au0828_rc_suspend(struct au0828_dev *dev); |
| 335 | extern int au0828_rc_resume(struct au0828_dev *dev); |
| 336 | #else |
| 337 | static inline int au0828_rc_register(struct au0828_dev *dev) { return 0; } |
| 338 | static inline void au0828_rc_unregister(struct au0828_dev *dev) { } |
| 339 | static inline int au0828_rc_suspend(struct au0828_dev *dev) { return 0; } |
| 340 | static inline int au0828_rc_resume(struct au0828_dev *dev) { return 0; } |
| 341 | #endif |