Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 1 | /* |
| 2 | * wm8739 |
| 3 | * |
| 4 | * Copyright (C) 2005 T. Adachi <tadachi@tadachi-net.com> |
| 5 | * |
| 6 | * Copyright (C) 2005 Hans Verkuil <hverkuil@xs4all.nl> |
| 7 | * - Cleanup |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or modify |
| 10 | * it under the terms of the GNU General Public License as published by |
| 11 | * the Free Software Foundation; either version 2 of the License, or |
| 12 | * (at your option) any later version. |
| 13 | * |
| 14 | * This program is distributed in the hope that it will be useful, |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | * GNU General Public License for more details. |
| 18 | * |
| 19 | * You should have received a copy of the GNU General Public License |
| 20 | * along with this program; if not, write to the Free Software |
| 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 22 | */ |
| 23 | |
| 24 | #include <linux/module.h> |
| 25 | #include <linux/types.h> |
Tejun Heo | 5a0e3ad | 2010-03-24 17:04:11 +0900 | [diff] [blame] | 26 | #include <linux/slab.h> |
Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 27 | #include <linux/ioctl.h> |
| 28 | #include <asm/uaccess.h> |
| 29 | #include <linux/i2c.h> |
Hans Verkuil | 33b687c | 2008-07-25 05:32:50 -0300 | [diff] [blame] | 30 | #include <linux/videodev2.h> |
Hans Verkuil | f1460e9 | 2008-11-29 13:02:26 -0300 | [diff] [blame] | 31 | #include <media/v4l2-device.h> |
Hans Verkuil | 74cab31 | 2007-04-27 12:31:26 -0300 | [diff] [blame] | 32 | #include <media/v4l2-chip-ident.h> |
Hans Verkuil | f687d19 | 2010-05-24 10:18:26 -0300 | [diff] [blame] | 33 | #include <media/v4l2-ctrls.h> |
Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 34 | |
| 35 | MODULE_DESCRIPTION("wm8739 driver"); |
| 36 | MODULE_AUTHOR("T. Adachi, Hans Verkuil"); |
| 37 | MODULE_LICENSE("GPL"); |
| 38 | |
Hans Verkuil | 099b8e7 | 2007-11-01 07:45:54 -0300 | [diff] [blame] | 39 | static int debug; |
Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 40 | |
| 41 | module_param(debug, int, 0644); |
| 42 | |
| 43 | MODULE_PARM_DESC(debug, "Debug level (0-1)"); |
| 44 | |
| 45 | |
Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 46 | /* ------------------------------------------------------------------------ */ |
| 47 | |
| 48 | enum { |
| 49 | R0 = 0, R1, |
| 50 | R5 = 5, R6, R7, R8, R9, R15 = 15, |
| 51 | TOT_REGS |
| 52 | }; |
| 53 | |
| 54 | struct wm8739_state { |
Hans Verkuil | f1460e9 | 2008-11-29 13:02:26 -0300 | [diff] [blame] | 55 | struct v4l2_subdev sd; |
Hans Verkuil | f687d19 | 2010-05-24 10:18:26 -0300 | [diff] [blame] | 56 | struct v4l2_ctrl_handler hdl; |
| 57 | struct { |
| 58 | /* audio cluster */ |
| 59 | struct v4l2_ctrl *volume; |
| 60 | struct v4l2_ctrl *mute; |
| 61 | struct v4l2_ctrl *balance; |
| 62 | }; |
Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 63 | u32 clock_freq; |
Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 64 | }; |
| 65 | |
Hans Verkuil | f1460e9 | 2008-11-29 13:02:26 -0300 | [diff] [blame] | 66 | static inline struct wm8739_state *to_state(struct v4l2_subdev *sd) |
| 67 | { |
| 68 | return container_of(sd, struct wm8739_state, sd); |
| 69 | } |
| 70 | |
Hans Verkuil | f687d19 | 2010-05-24 10:18:26 -0300 | [diff] [blame] | 71 | static inline struct v4l2_subdev *to_sd(struct v4l2_ctrl *ctrl) |
| 72 | { |
| 73 | return &container_of(ctrl->handler, struct wm8739_state, hdl)->sd; |
| 74 | } |
| 75 | |
Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 76 | /* ------------------------------------------------------------------------ */ |
| 77 | |
Hans Verkuil | f1460e9 | 2008-11-29 13:02:26 -0300 | [diff] [blame] | 78 | static int wm8739_write(struct v4l2_subdev *sd, int reg, u16 val) |
Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 79 | { |
Hans Verkuil | f1460e9 | 2008-11-29 13:02:26 -0300 | [diff] [blame] | 80 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 81 | int i; |
| 82 | |
| 83 | if (reg < 0 || reg >= TOT_REGS) { |
Hans Verkuil | f1460e9 | 2008-11-29 13:02:26 -0300 | [diff] [blame] | 84 | v4l2_err(sd, "Invalid register R%d\n", reg); |
Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 85 | return -1; |
| 86 | } |
| 87 | |
Hans Verkuil | f1460e9 | 2008-11-29 13:02:26 -0300 | [diff] [blame] | 88 | v4l2_dbg(1, debug, sd, "write: %02x %02x\n", reg, val); |
Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 89 | |
Hans Verkuil | 099b8e7 | 2007-11-01 07:45:54 -0300 | [diff] [blame] | 90 | for (i = 0; i < 3; i++) |
| 91 | if (i2c_smbus_write_byte_data(client, |
| 92 | (reg << 1) | (val >> 8), val & 0xff) == 0) |
Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 93 | return 0; |
Hans Verkuil | f1460e9 | 2008-11-29 13:02:26 -0300 | [diff] [blame] | 94 | v4l2_err(sd, "I2C: cannot write %03x to register R%d\n", val, reg); |
Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 95 | return -1; |
| 96 | } |
| 97 | |
Hans Verkuil | f687d19 | 2010-05-24 10:18:26 -0300 | [diff] [blame] | 98 | static int wm8739_s_ctrl(struct v4l2_ctrl *ctrl) |
Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 99 | { |
Hans Verkuil | f687d19 | 2010-05-24 10:18:26 -0300 | [diff] [blame] | 100 | struct v4l2_subdev *sd = to_sd(ctrl); |
Hans Verkuil | f1460e9 | 2008-11-29 13:02:26 -0300 | [diff] [blame] | 101 | struct wm8739_state *state = to_state(sd); |
Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 102 | unsigned int work_l, work_r; |
Hans Verkuil | f687d19 | 2010-05-24 10:18:26 -0300 | [diff] [blame] | 103 | u8 vol_l; /* +12dB to -34.5dB 1.5dB step (5bit) def:0dB */ |
| 104 | u8 vol_r; /* +12dB to -34.5dB 1.5dB step (5bit) def:0dB */ |
| 105 | u16 mute; |
Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 106 | |
| 107 | switch (ctrl->id) { |
Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 108 | case V4L2_CID_AUDIO_VOLUME: |
Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 109 | break; |
| 110 | |
| 111 | default: |
| 112 | return -EINVAL; |
| 113 | } |
| 114 | |
| 115 | /* normalize ( 65535 to 0 -> 31 to 0 (12dB to -34.5dB) ) */ |
Hans Verkuil | f687d19 | 2010-05-24 10:18:26 -0300 | [diff] [blame] | 116 | work_l = (min(65536 - state->balance->val, 32768) * state->volume->val) / 32768; |
| 117 | work_r = (min(state->balance->val, 32768) * state->volume->val) / 32768; |
Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 118 | |
Hans Verkuil | f687d19 | 2010-05-24 10:18:26 -0300 | [diff] [blame] | 119 | vol_l = (long)work_l * 31 / 65535; |
| 120 | vol_r = (long)work_r * 31 / 65535; |
Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 121 | |
| 122 | /* set audio volume etc. */ |
Hans Verkuil | f687d19 | 2010-05-24 10:18:26 -0300 | [diff] [blame] | 123 | mute = state->mute->val ? 0x80 : 0; |
| 124 | |
| 125 | /* Volume setting: bits 0-4, 0x1f = 12 dB, 0x00 = -34.5 dB |
| 126 | * Default setting: 0x17 = 0 dB |
| 127 | */ |
| 128 | wm8739_write(sd, R0, (vol_l & 0x1f) | mute); |
| 129 | wm8739_write(sd, R1, (vol_r & 0x1f) | mute); |
Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 130 | return 0; |
| 131 | } |
| 132 | |
| 133 | /* ------------------------------------------------------------------------ */ |
| 134 | |
Hans Verkuil | f1460e9 | 2008-11-29 13:02:26 -0300 | [diff] [blame] | 135 | static int wm8739_s_clock_freq(struct v4l2_subdev *sd, u32 audiofreq) |
Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 136 | { |
Hans Verkuil | f1460e9 | 2008-11-29 13:02:26 -0300 | [diff] [blame] | 137 | struct wm8739_state *state = to_state(sd); |
Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 138 | |
Hans Verkuil | f1460e9 | 2008-11-29 13:02:26 -0300 | [diff] [blame] | 139 | state->clock_freq = audiofreq; |
| 140 | /* de-activate */ |
| 141 | wm8739_write(sd, R9, 0x000); |
| 142 | switch (audiofreq) { |
| 143 | case 44100: |
| 144 | /* 256fps, fs=44.1k */ |
| 145 | wm8739_write(sd, R8, 0x020); |
Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 146 | break; |
Hans Verkuil | f1460e9 | 2008-11-29 13:02:26 -0300 | [diff] [blame] | 147 | case 48000: |
| 148 | /* 256fps, fs=48k */ |
| 149 | wm8739_write(sd, R8, 0x000); |
Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 150 | break; |
Hans Verkuil | f1460e9 | 2008-11-29 13:02:26 -0300 | [diff] [blame] | 151 | case 32000: |
| 152 | /* 256fps, fs=32k */ |
| 153 | wm8739_write(sd, R8, 0x018); |
| 154 | break; |
Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 155 | default: |
Hans Verkuil | f1460e9 | 2008-11-29 13:02:26 -0300 | [diff] [blame] | 156 | break; |
Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 157 | } |
Hans Verkuil | f1460e9 | 2008-11-29 13:02:26 -0300 | [diff] [blame] | 158 | /* activate */ |
| 159 | wm8739_write(sd, R9, 0x001); |
Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 160 | return 0; |
| 161 | } |
| 162 | |
Hans Verkuil | aecde8b | 2008-12-30 07:14:19 -0300 | [diff] [blame] | 163 | static int wm8739_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) |
Hans Verkuil | f1460e9 | 2008-11-29 13:02:26 -0300 | [diff] [blame] | 164 | { |
| 165 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
| 166 | |
| 167 | return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_WM8739, 0); |
| 168 | } |
| 169 | |
| 170 | static int wm8739_log_status(struct v4l2_subdev *sd) |
| 171 | { |
| 172 | struct wm8739_state *state = to_state(sd); |
| 173 | |
| 174 | v4l2_info(sd, "Frequency: %u Hz\n", state->clock_freq); |
Hans Verkuil | f687d19 | 2010-05-24 10:18:26 -0300 | [diff] [blame] | 175 | v4l2_ctrl_handler_log_status(&state->hdl, sd->name); |
Hans Verkuil | f1460e9 | 2008-11-29 13:02:26 -0300 | [diff] [blame] | 176 | return 0; |
| 177 | } |
| 178 | |
Hans Verkuil | f1460e9 | 2008-11-29 13:02:26 -0300 | [diff] [blame] | 179 | /* ----------------------------------------------------------------------- */ |
| 180 | |
Hans Verkuil | f687d19 | 2010-05-24 10:18:26 -0300 | [diff] [blame] | 181 | static const struct v4l2_ctrl_ops wm8739_ctrl_ops = { |
| 182 | .s_ctrl = wm8739_s_ctrl, |
| 183 | }; |
| 184 | |
Hans Verkuil | f1460e9 | 2008-11-29 13:02:26 -0300 | [diff] [blame] | 185 | static const struct v4l2_subdev_core_ops wm8739_core_ops = { |
| 186 | .log_status = wm8739_log_status, |
| 187 | .g_chip_ident = wm8739_g_chip_ident, |
Hans Verkuil | f687d19 | 2010-05-24 10:18:26 -0300 | [diff] [blame] | 188 | .g_ext_ctrls = v4l2_subdev_g_ext_ctrls, |
| 189 | .try_ext_ctrls = v4l2_subdev_try_ext_ctrls, |
| 190 | .s_ext_ctrls = v4l2_subdev_s_ext_ctrls, |
| 191 | .g_ctrl = v4l2_subdev_g_ctrl, |
| 192 | .s_ctrl = v4l2_subdev_s_ctrl, |
| 193 | .queryctrl = v4l2_subdev_queryctrl, |
| 194 | .querymenu = v4l2_subdev_querymenu, |
Hans Verkuil | f1460e9 | 2008-11-29 13:02:26 -0300 | [diff] [blame] | 195 | }; |
| 196 | |
| 197 | static const struct v4l2_subdev_audio_ops wm8739_audio_ops = { |
| 198 | .s_clock_freq = wm8739_s_clock_freq, |
| 199 | }; |
| 200 | |
| 201 | static const struct v4l2_subdev_ops wm8739_ops = { |
| 202 | .core = &wm8739_core_ops, |
| 203 | .audio = &wm8739_audio_ops, |
| 204 | }; |
| 205 | |
Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 206 | /* ------------------------------------------------------------------------ */ |
| 207 | |
| 208 | /* i2c implementation */ |
| 209 | |
Jean Delvare | d2653e9 | 2008-04-29 23:11:39 +0200 | [diff] [blame] | 210 | static int wm8739_probe(struct i2c_client *client, |
| 211 | const struct i2c_device_id *id) |
Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 212 | { |
Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 213 | struct wm8739_state *state; |
Hans Verkuil | f1460e9 | 2008-11-29 13:02:26 -0300 | [diff] [blame] | 214 | struct v4l2_subdev *sd; |
Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 215 | |
Hans Verkuil | 188f345 | 2007-09-16 10:47:15 -0300 | [diff] [blame] | 216 | /* Check if the adapter supports the needed features */ |
| 217 | if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) |
| 218 | return -EIO; |
| 219 | |
Hans Verkuil | 099b8e7 | 2007-11-01 07:45:54 -0300 | [diff] [blame] | 220 | v4l_info(client, "chip found @ 0x%x (%s)\n", |
| 221 | client->addr << 1, client->adapter->name); |
Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 222 | |
Hans Verkuil | f687d19 | 2010-05-24 10:18:26 -0300 | [diff] [blame] | 223 | state = kzalloc(sizeof(struct wm8739_state), GFP_KERNEL); |
Hans Verkuil | 6c832e3 | 2008-08-24 06:29:30 -0300 | [diff] [blame] | 224 | if (state == NULL) |
Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 225 | return -ENOMEM; |
Hans Verkuil | f1460e9 | 2008-11-29 13:02:26 -0300 | [diff] [blame] | 226 | sd = &state->sd; |
| 227 | v4l2_i2c_subdev_init(sd, client, &wm8739_ops); |
Hans Verkuil | f687d19 | 2010-05-24 10:18:26 -0300 | [diff] [blame] | 228 | v4l2_ctrl_handler_init(&state->hdl, 2); |
| 229 | state->volume = v4l2_ctrl_new_std(&state->hdl, &wm8739_ctrl_ops, |
| 230 | V4L2_CID_AUDIO_VOLUME, 0, 65535, 65535 / 100, 50736); |
| 231 | state->mute = v4l2_ctrl_new_std(&state->hdl, &wm8739_ctrl_ops, |
| 232 | V4L2_CID_AUDIO_MUTE, 0, 1, 1, 0); |
| 233 | state->balance = v4l2_ctrl_new_std(&state->hdl, &wm8739_ctrl_ops, |
| 234 | V4L2_CID_AUDIO_BALANCE, 0, 65535, 65535 / 100, 32768); |
| 235 | sd->ctrl_handler = &state->hdl; |
| 236 | if (state->hdl.error) { |
| 237 | int err = state->hdl.error; |
| 238 | |
| 239 | v4l2_ctrl_handler_free(&state->hdl); |
| 240 | kfree(state); |
| 241 | return err; |
| 242 | } |
| 243 | v4l2_ctrl_cluster(3, &state->volume); |
| 244 | |
Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 245 | state->clock_freq = 48000; |
Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 246 | |
Hans Verkuil | 099b8e7 | 2007-11-01 07:45:54 -0300 | [diff] [blame] | 247 | /* Initialize wm8739 */ |
| 248 | |
| 249 | /* reset */ |
Hans Verkuil | f1460e9 | 2008-11-29 13:02:26 -0300 | [diff] [blame] | 250 | wm8739_write(sd, R15, 0x00); |
Hans Verkuil | 099b8e7 | 2007-11-01 07:45:54 -0300 | [diff] [blame] | 251 | /* filter setting, high path, offet clear */ |
Hans Verkuil | f1460e9 | 2008-11-29 13:02:26 -0300 | [diff] [blame] | 252 | wm8739_write(sd, R5, 0x000); |
Hans Verkuil | 099b8e7 | 2007-11-01 07:45:54 -0300 | [diff] [blame] | 253 | /* ADC, OSC, Power Off mode Disable */ |
Hans Verkuil | f1460e9 | 2008-11-29 13:02:26 -0300 | [diff] [blame] | 254 | wm8739_write(sd, R6, 0x000); |
Hans Verkuil | 099b8e7 | 2007-11-01 07:45:54 -0300 | [diff] [blame] | 255 | /* Digital Audio interface format: |
| 256 | Enable Master mode, 24 bit, MSB first/left justified */ |
Hans Verkuil | f1460e9 | 2008-11-29 13:02:26 -0300 | [diff] [blame] | 257 | wm8739_write(sd, R7, 0x049); |
Hans Verkuil | 099b8e7 | 2007-11-01 07:45:54 -0300 | [diff] [blame] | 258 | /* sampling control: normal, 256fs, 48KHz sampling rate */ |
Hans Verkuil | f1460e9 | 2008-11-29 13:02:26 -0300 | [diff] [blame] | 259 | wm8739_write(sd, R8, 0x000); |
Hans Verkuil | 099b8e7 | 2007-11-01 07:45:54 -0300 | [diff] [blame] | 260 | /* activate */ |
Hans Verkuil | f1460e9 | 2008-11-29 13:02:26 -0300 | [diff] [blame] | 261 | wm8739_write(sd, R9, 0x001); |
Hans Verkuil | 099b8e7 | 2007-11-01 07:45:54 -0300 | [diff] [blame] | 262 | /* set volume/mute */ |
Hans Verkuil | f687d19 | 2010-05-24 10:18:26 -0300 | [diff] [blame] | 263 | v4l2_ctrl_handler_setup(&state->hdl); |
Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 264 | return 0; |
| 265 | } |
| 266 | |
Hans Verkuil | 49457cc | 2007-09-13 11:10:07 -0300 | [diff] [blame] | 267 | static int wm8739_remove(struct i2c_client *client) |
Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 268 | { |
Hans Verkuil | f1460e9 | 2008-11-29 13:02:26 -0300 | [diff] [blame] | 269 | struct v4l2_subdev *sd = i2c_get_clientdata(client); |
Hans Verkuil | f687d19 | 2010-05-24 10:18:26 -0300 | [diff] [blame] | 270 | struct wm8739_state *state = to_state(sd); |
Hans Verkuil | f1460e9 | 2008-11-29 13:02:26 -0300 | [diff] [blame] | 271 | |
| 272 | v4l2_device_unregister_subdev(sd); |
Hans Verkuil | f687d19 | 2010-05-24 10:18:26 -0300 | [diff] [blame] | 273 | v4l2_ctrl_handler_free(&state->hdl); |
Hans Verkuil | f1460e9 | 2008-11-29 13:02:26 -0300 | [diff] [blame] | 274 | kfree(to_state(sd)); |
Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 275 | return 0; |
| 276 | } |
| 277 | |
Jean Delvare | af29486 | 2008-05-18 20:49:40 +0200 | [diff] [blame] | 278 | static const struct i2c_device_id wm8739_id[] = { |
| 279 | { "wm8739", 0 }, |
| 280 | { } |
| 281 | }; |
| 282 | MODULE_DEVICE_TABLE(i2c, wm8739_id); |
| 283 | |
Hans Verkuil | 49facfa | 2010-09-15 14:58:16 -0300 | [diff] [blame] | 284 | static struct i2c_driver wm8739_driver = { |
| 285 | .driver = { |
| 286 | .owner = THIS_MODULE, |
| 287 | .name = "wm8739", |
| 288 | }, |
| 289 | .probe = wm8739_probe, |
| 290 | .remove = wm8739_remove, |
| 291 | .id_table = wm8739_id, |
Hans Verkuil | 75c4570 | 2006-03-28 18:23:48 -0300 | [diff] [blame] | 292 | }; |
Hans Verkuil | 49facfa | 2010-09-15 14:58:16 -0300 | [diff] [blame] | 293 | |
Axel Lin | c6e8d86 | 2012-02-12 06:56:32 -0300 | [diff] [blame] | 294 | module_i2c_driver(wm8739_driver); |