blob: 46a25f7054568100da1aea15eea4f672e20c456e [file] [log] [blame]
Thomas Gleixnerc942fdd2019-05-27 08:55:06 +02001// SPDX-License-Identifier: GPL-2.0-or-later
Helen Koikef2fe8902017-04-07 14:55:19 -03002/*
3 * vimc-sensor.c Virtual Media Controller Driver
4 *
5 * Copyright (C) 2015-2017 Helen Koike <helen.fornazier@gmail.com>
Helen Koikef2fe8902017-04-07 14:55:19 -03006 */
7
Helen Fornazier4a29b702017-06-19 14:00:18 -03008#include <linux/component.h>
Helen Fornazier4a29b702017-06-19 14:00:18 -03009#include <linux/module.h>
Randy Dunlapac316722018-06-19 22:47:28 -070010#include <linux/mod_devicetable.h>
Helen Fornazier4a29b702017-06-19 14:00:18 -030011#include <linux/platform_device.h>
Helen Koikef2fe8902017-04-07 14:55:19 -030012#include <linux/v4l2-mediabus.h>
13#include <linux/vmalloc.h>
Hans Verkuil52cf1d92017-11-06 05:20:01 -050014#include <media/v4l2-ctrls.h>
Hans Verkuil3da7ee92018-02-02 08:00:32 -050015#include <media/v4l2-event.h>
Helen Koikef2fe8902017-04-07 14:55:19 -030016#include <media/v4l2-subdev.h>
Mauro Carvalho Chehab1beb6232017-10-09 06:02:25 -040017#include <media/tpg/v4l2-tpg.h>
Helen Koikef2fe8902017-04-07 14:55:19 -030018
Helen Fornazier4a29b702017-06-19 14:00:18 -030019#include "vimc-common.h"
20
21#define VIMC_SEN_DRV_NAME "vimc-sensor"
Helen Koikef2fe8902017-04-07 14:55:19 -030022
23struct vimc_sen_device {
24 struct vimc_ent_device ved;
25 struct v4l2_subdev sd;
Helen Fornazier4a29b702017-06-19 14:00:18 -030026 struct device *dev;
Helen Fornazier554946c2017-06-19 14:00:10 -030027 struct tpg_data tpg;
Helen Koikef2fe8902017-04-07 14:55:19 -030028 struct task_struct *kthread_sen;
29 u8 *frame;
30 /* The active format */
31 struct v4l2_mbus_framefmt mbus_format;
Hans Verkuil52cf1d92017-11-06 05:20:01 -050032 struct v4l2_ctrl_handler hdl;
Helen Koikef2fe8902017-04-07 14:55:19 -030033};
34
Helen Fornazier88ad71a2017-06-19 14:00:16 -030035static const struct v4l2_mbus_framefmt fmt_default = {
36 .width = 640,
37 .height = 480,
38 .code = MEDIA_BUS_FMT_RGB888_1X24,
39 .field = V4L2_FIELD_NONE,
40 .colorspace = V4L2_COLORSPACE_DEFAULT,
41};
42
43static int vimc_sen_init_cfg(struct v4l2_subdev *sd,
44 struct v4l2_subdev_pad_config *cfg)
45{
46 unsigned int i;
47
48 for (i = 0; i < sd->entity.num_pads; i++) {
49 struct v4l2_mbus_framefmt *mf;
50
51 mf = v4l2_subdev_get_try_format(sd, cfg, i);
52 *mf = fmt_default;
53 }
54
55 return 0;
56}
57
Helen Koikef2fe8902017-04-07 14:55:19 -030058static int vimc_sen_enum_frame_size(struct v4l2_subdev *sd,
59 struct v4l2_subdev_pad_config *cfg,
60 struct v4l2_subdev_frame_size_enum *fse)
61{
Helen Koikef2fe8902017-04-07 14:55:19 -030062 if (fse->index)
63 return -EINVAL;
64
Helen Fornazier88ad71a2017-06-19 14:00:16 -030065 fse->min_width = VIMC_FRAME_MIN_WIDTH;
66 fse->max_width = VIMC_FRAME_MAX_WIDTH;
67 fse->min_height = VIMC_FRAME_MIN_HEIGHT;
68 fse->max_height = VIMC_FRAME_MAX_HEIGHT;
Helen Koikef2fe8902017-04-07 14:55:19 -030069
70 return 0;
71}
72
73static int vimc_sen_get_fmt(struct v4l2_subdev *sd,
74 struct v4l2_subdev_pad_config *cfg,
Helen Fornazier88ad71a2017-06-19 14:00:16 -030075 struct v4l2_subdev_format *fmt)
Helen Koikef2fe8902017-04-07 14:55:19 -030076{
77 struct vimc_sen_device *vsen =
78 container_of(sd, struct vimc_sen_device, sd);
79
Helen Fornazier88ad71a2017-06-19 14:00:16 -030080 fmt->format = fmt->which == V4L2_SUBDEV_FORMAT_TRY ?
81 *v4l2_subdev_get_try_format(sd, cfg, fmt->pad) :
82 vsen->mbus_format;
Helen Koikef2fe8902017-04-07 14:55:19 -030083
84 return 0;
85}
86
Helen Fornazier554946c2017-06-19 14:00:10 -030087static void vimc_sen_tpg_s_format(struct vimc_sen_device *vsen)
88{
Helen Fornazierb6c61a62019-03-13 14:29:37 -040089 u32 pixelformat = vsen->ved.stream->producer_pixfmt;
90 const struct v4l2_format_info *pix_info;
91
92 pix_info = v4l2_format_info(pixelformat);
Helen Fornazier554946c2017-06-19 14:00:10 -030093
94 tpg_reset_source(&vsen->tpg, vsen->mbus_format.width,
95 vsen->mbus_format.height, vsen->mbus_format.field);
Helen Fornazierb6c61a62019-03-13 14:29:37 -040096 tpg_s_bytesperline(&vsen->tpg, 0,
97 vsen->mbus_format.width * pix_info->bpp[0]);
Helen Fornazier554946c2017-06-19 14:00:10 -030098 tpg_s_buf_height(&vsen->tpg, vsen->mbus_format.height);
Helen Fornazierb6c61a62019-03-13 14:29:37 -040099 tpg_s_fourcc(&vsen->tpg, pixelformat);
Helen Fornazier554946c2017-06-19 14:00:10 -0300100 /* TODO: add support for V4L2_FIELD_ALTERNATE */
101 tpg_s_field(&vsen->tpg, vsen->mbus_format.field, false);
102 tpg_s_colorspace(&vsen->tpg, vsen->mbus_format.colorspace);
103 tpg_s_ycbcr_enc(&vsen->tpg, vsen->mbus_format.ycbcr_enc);
104 tpg_s_quantization(&vsen->tpg, vsen->mbus_format.quantization);
105 tpg_s_xfer_func(&vsen->tpg, vsen->mbus_format.xfer_func);
106}
107
Helen Fornazier88ad71a2017-06-19 14:00:16 -0300108static void vimc_sen_adjust_fmt(struct v4l2_mbus_framefmt *fmt)
109{
Helen Fornazier88ad71a2017-06-19 14:00:16 -0300110 fmt->width = clamp_t(u32, fmt->width, VIMC_FRAME_MIN_WIDTH,
111 VIMC_FRAME_MAX_WIDTH) & ~1;
112 fmt->height = clamp_t(u32, fmt->height, VIMC_FRAME_MIN_HEIGHT,
113 VIMC_FRAME_MAX_HEIGHT) & ~1;
114
115 /* TODO: add support for V4L2_FIELD_ALTERNATE */
116 if (fmt->field == V4L2_FIELD_ANY || fmt->field == V4L2_FIELD_ALTERNATE)
117 fmt->field = fmt_default.field;
118
119 vimc_colorimetry_clamp(fmt);
120}
121
122static int vimc_sen_set_fmt(struct v4l2_subdev *sd,
123 struct v4l2_subdev_pad_config *cfg,
124 struct v4l2_subdev_format *fmt)
125{
126 struct vimc_sen_device *vsen = v4l2_get_subdevdata(sd);
127 struct v4l2_mbus_framefmt *mf;
128
Helen Fornazierb6c61a62019-03-13 14:29:37 -0400129 if (!vimc_mbus_code_supported(fmt->format.code))
130 fmt->format.code = fmt_default.code;
131
Helen Fornazier88ad71a2017-06-19 14:00:16 -0300132 if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) {
133 /* Do not change the format while stream is on */
134 if (vsen->frame)
135 return -EBUSY;
136
137 mf = &vsen->mbus_format;
138 } else {
139 mf = v4l2_subdev_get_try_format(sd, cfg, fmt->pad);
140 }
141
142 /* Set the new format */
143 vimc_sen_adjust_fmt(&fmt->format);
144
Helen Fornazier4a29b702017-06-19 14:00:18 -0300145 dev_dbg(vsen->dev, "%s: format update: "
Helen Fornazier88ad71a2017-06-19 14:00:16 -0300146 "old:%dx%d (0x%x, %d, %d, %d, %d) "
147 "new:%dx%d (0x%x, %d, %d, %d, %d)\n", vsen->sd.name,
148 /* old */
149 mf->width, mf->height, mf->code,
150 mf->colorspace, mf->quantization,
151 mf->xfer_func, mf->ycbcr_enc,
152 /* new */
153 fmt->format.width, fmt->format.height, fmt->format.code,
154 fmt->format.colorspace, fmt->format.quantization,
155 fmt->format.xfer_func, fmt->format.ycbcr_enc);
156
157 *mf = fmt->format;
158
159 return 0;
160}
161
Helen Koikef2fe8902017-04-07 14:55:19 -0300162static const struct v4l2_subdev_pad_ops vimc_sen_pad_ops = {
Helen Fornazier88ad71a2017-06-19 14:00:16 -0300163 .init_cfg = vimc_sen_init_cfg,
Helen Fornazierb6c61a62019-03-13 14:29:37 -0400164 .enum_mbus_code = vimc_enum_mbus_code,
Helen Koikef2fe8902017-04-07 14:55:19 -0300165 .enum_frame_size = vimc_sen_enum_frame_size,
166 .get_fmt = vimc_sen_get_fmt,
Helen Fornazier88ad71a2017-06-19 14:00:16 -0300167 .set_fmt = vimc_sen_set_fmt,
Helen Koikef2fe8902017-04-07 14:55:19 -0300168};
169
Lucas A. M. Magalhãesadc589d2019-01-21 20:05:01 -0500170static void *vimc_sen_process_frame(struct vimc_ent_device *ved,
171 const void *sink_frame)
Helen Koikef2fe8902017-04-07 14:55:19 -0300172{
Lucas A. M. Magalhãesadc589d2019-01-21 20:05:01 -0500173 struct vimc_sen_device *vsen = container_of(ved, struct vimc_sen_device,
174 ved);
Helen Koikef2fe8902017-04-07 14:55:19 -0300175
Lucas A. M. Magalhãesadc589d2019-01-21 20:05:01 -0500176 tpg_fill_plane_buffer(&vsen->tpg, 0, 0, vsen->frame);
177 return vsen->frame;
Helen Koikef2fe8902017-04-07 14:55:19 -0300178}
179
180static int vimc_sen_s_stream(struct v4l2_subdev *sd, int enable)
181{
182 struct vimc_sen_device *vsen =
183 container_of(sd, struct vimc_sen_device, sd);
Helen Koikef2fe8902017-04-07 14:55:19 -0300184
185 if (enable) {
Helen Fornazierb6c61a62019-03-13 14:29:37 -0400186 u32 pixelformat = vsen->ved.stream->producer_pixfmt;
187 const struct v4l2_format_info *pix_info;
Helen Fornazier554946c2017-06-19 14:00:10 -0300188 unsigned int frame_size;
Helen Koikef2fe8902017-04-07 14:55:19 -0300189
190 if (vsen->kthread_sen)
Helen Fornazier554946c2017-06-19 14:00:10 -0300191 /* tpg is already executing */
192 return 0;
Helen Koikef2fe8902017-04-07 14:55:19 -0300193
194 /* Calculate the frame size */
Helen Fornazierb6c61a62019-03-13 14:29:37 -0400195 pix_info = v4l2_format_info(pixelformat);
196 frame_size = vsen->mbus_format.width * pix_info->bpp[0] *
Helen Fornazier554946c2017-06-19 14:00:10 -0300197 vsen->mbus_format.height;
Helen Koikef2fe8902017-04-07 14:55:19 -0300198
199 /*
200 * Allocate the frame buffer. Use vmalloc to be able to
201 * allocate a large amount of memory
202 */
Helen Fornazier554946c2017-06-19 14:00:10 -0300203 vsen->frame = vmalloc(frame_size);
Helen Koikef2fe8902017-04-07 14:55:19 -0300204 if (!vsen->frame)
205 return -ENOMEM;
206
Helen Fornazier554946c2017-06-19 14:00:10 -0300207 /* configure the test pattern generator */
208 vimc_sen_tpg_s_format(vsen);
209
Helen Koikef2fe8902017-04-07 14:55:19 -0300210 } else {
Helen Koikef2fe8902017-04-07 14:55:19 -0300211
Helen Koikef2fe8902017-04-07 14:55:19 -0300212 vfree(vsen->frame);
213 vsen->frame = NULL;
Helen Fornazier554946c2017-06-19 14:00:10 -0300214 return 0;
Helen Koikef2fe8902017-04-07 14:55:19 -0300215 }
216
217 return 0;
218}
219
Julia Lawallda411ab2018-10-27 08:49:05 -0400220static const struct v4l2_subdev_core_ops vimc_sen_core_ops = {
Hans Verkuil3da7ee92018-02-02 08:00:32 -0500221 .log_status = v4l2_ctrl_subdev_log_status,
222 .subscribe_event = v4l2_ctrl_subdev_subscribe_event,
223 .unsubscribe_event = v4l2_event_subdev_unsubscribe,
224};
225
Julia Lawallebf7a642017-08-08 06:58:28 -0400226static const struct v4l2_subdev_video_ops vimc_sen_video_ops = {
Helen Koikef2fe8902017-04-07 14:55:19 -0300227 .s_stream = vimc_sen_s_stream,
228};
229
230static const struct v4l2_subdev_ops vimc_sen_ops = {
Hans Verkuil3da7ee92018-02-02 08:00:32 -0500231 .core = &vimc_sen_core_ops,
Helen Koikef2fe8902017-04-07 14:55:19 -0300232 .pad = &vimc_sen_pad_ops,
233 .video = &vimc_sen_video_ops,
234};
235
Hans Verkuil52cf1d92017-11-06 05:20:01 -0500236static int vimc_sen_s_ctrl(struct v4l2_ctrl *ctrl)
237{
238 struct vimc_sen_device *vsen =
239 container_of(ctrl->handler, struct vimc_sen_device, hdl);
240
241 switch (ctrl->id) {
242 case VIMC_CID_TEST_PATTERN:
243 tpg_s_pattern(&vsen->tpg, ctrl->val);
244 break;
245 case V4L2_CID_HFLIP:
246 tpg_s_hflip(&vsen->tpg, ctrl->val);
247 break;
248 case V4L2_CID_VFLIP:
249 tpg_s_vflip(&vsen->tpg, ctrl->val);
250 break;
Guilherme Gallo7b0bfa52018-09-03 21:45:59 -0400251 case V4L2_CID_BRIGHTNESS:
252 tpg_s_brightness(&vsen->tpg, ctrl->val);
253 break;
254 case V4L2_CID_CONTRAST:
255 tpg_s_contrast(&vsen->tpg, ctrl->val);
256 break;
257 case V4L2_CID_HUE:
258 tpg_s_hue(&vsen->tpg, ctrl->val);
259 break;
260 case V4L2_CID_SATURATION:
261 tpg_s_saturation(&vsen->tpg, ctrl->val);
262 break;
Hans Verkuil52cf1d92017-11-06 05:20:01 -0500263 default:
264 return -EINVAL;
265 }
266 return 0;
267}
268
269static const struct v4l2_ctrl_ops vimc_sen_ctrl_ops = {
270 .s_ctrl = vimc_sen_s_ctrl,
271};
272
Hans Verkuil2b177f22019-03-05 03:36:20 -0500273static void vimc_sen_release(struct v4l2_subdev *sd)
274{
275 struct vimc_sen_device *vsen =
276 container_of(sd, struct vimc_sen_device, sd);
277
278 v4l2_ctrl_handler_free(&vsen->hdl);
279 tpg_free(&vsen->tpg);
280 kfree(vsen);
281}
282
283static const struct v4l2_subdev_internal_ops vimc_sen_int_ops = {
284 .release = vimc_sen_release,
285};
286
Helen Fornazier4a29b702017-06-19 14:00:18 -0300287static void vimc_sen_comp_unbind(struct device *comp, struct device *master,
288 void *master_data)
Helen Koikef2fe8902017-04-07 14:55:19 -0300289{
Helen Fornazier4a29b702017-06-19 14:00:18 -0300290 struct vimc_ent_device *ved = dev_get_drvdata(comp);
Helen Koikef2fe8902017-04-07 14:55:19 -0300291 struct vimc_sen_device *vsen =
292 container_of(ved, struct vimc_sen_device, ved);
293
Helen Fornazierc1495432017-06-19 14:00:12 -0300294 vimc_ent_sd_unregister(ved, &vsen->sd);
Helen Koikef2fe8902017-04-07 14:55:19 -0300295}
296
Hans Verkuil52cf1d92017-11-06 05:20:01 -0500297/* Image Processing Controls */
298static const struct v4l2_ctrl_config vimc_sen_ctrl_class = {
299 .flags = V4L2_CTRL_FLAG_READ_ONLY | V4L2_CTRL_FLAG_WRITE_ONLY,
300 .id = VIMC_CID_VIMC_CLASS,
301 .name = "VIMC Controls",
302 .type = V4L2_CTRL_TYPE_CTRL_CLASS,
303};
304
305static const struct v4l2_ctrl_config vimc_sen_ctrl_test_pattern = {
306 .ops = &vimc_sen_ctrl_ops,
307 .id = VIMC_CID_TEST_PATTERN,
308 .name = "Test Pattern",
309 .type = V4L2_CTRL_TYPE_MENU,
310 .max = TPG_PAT_NOISE,
311 .qmenu = tpg_pattern_strings,
312};
313
Helen Fornazier4a29b702017-06-19 14:00:18 -0300314static int vimc_sen_comp_bind(struct device *comp, struct device *master,
315 void *master_data)
Helen Koikef2fe8902017-04-07 14:55:19 -0300316{
Helen Fornazier4a29b702017-06-19 14:00:18 -0300317 struct v4l2_device *v4l2_dev = master_data;
318 struct vimc_platform_data *pdata = comp->platform_data;
Helen Koikef2fe8902017-04-07 14:55:19 -0300319 struct vimc_sen_device *vsen;
Helen Koikef2fe8902017-04-07 14:55:19 -0300320 int ret;
321
Helen Koikef2fe8902017-04-07 14:55:19 -0300322 /* Allocate the vsen struct */
323 vsen = kzalloc(sizeof(*vsen), GFP_KERNEL);
324 if (!vsen)
Helen Fornazier4a29b702017-06-19 14:00:18 -0300325 return -ENOMEM;
Helen Koikef2fe8902017-04-07 14:55:19 -0300326
Hans Verkuil52cf1d92017-11-06 05:20:01 -0500327 v4l2_ctrl_handler_init(&vsen->hdl, 4);
328
329 v4l2_ctrl_new_custom(&vsen->hdl, &vimc_sen_ctrl_class, NULL);
330 v4l2_ctrl_new_custom(&vsen->hdl, &vimc_sen_ctrl_test_pattern, NULL);
331 v4l2_ctrl_new_std(&vsen->hdl, &vimc_sen_ctrl_ops,
332 V4L2_CID_VFLIP, 0, 1, 1, 0);
333 v4l2_ctrl_new_std(&vsen->hdl, &vimc_sen_ctrl_ops,
334 V4L2_CID_HFLIP, 0, 1, 1, 0);
Guilherme Gallo7b0bfa52018-09-03 21:45:59 -0400335 v4l2_ctrl_new_std(&vsen->hdl, &vimc_sen_ctrl_ops,
336 V4L2_CID_BRIGHTNESS, 0, 255, 1, 128);
337 v4l2_ctrl_new_std(&vsen->hdl, &vimc_sen_ctrl_ops,
338 V4L2_CID_CONTRAST, 0, 255, 1, 128);
339 v4l2_ctrl_new_std(&vsen->hdl, &vimc_sen_ctrl_ops,
340 V4L2_CID_HUE, -128, 127, 1, 0);
341 v4l2_ctrl_new_std(&vsen->hdl, &vimc_sen_ctrl_ops,
342 V4L2_CID_SATURATION, 0, 255, 1, 128);
Hans Verkuil52cf1d92017-11-06 05:20:01 -0500343 vsen->sd.ctrl_handler = &vsen->hdl;
344 if (vsen->hdl.error) {
345 ret = vsen->hdl.error;
346 goto err_free_vsen;
347 }
348
Helen Fornazierc1495432017-06-19 14:00:12 -0300349 /* Initialize ved and sd */
Helen Fornazier4a29b702017-06-19 14:00:18 -0300350 ret = vimc_ent_sd_register(&vsen->ved, &vsen->sd, v4l2_dev,
351 pdata->entity_name,
Hans Verkuil1ceda322018-02-07 12:06:30 -0500352 MEDIA_ENT_F_CAM_SENSOR, 1,
Helen Fornazier4a29b702017-06-19 14:00:18 -0300353 (const unsigned long[1]) {MEDIA_PAD_FL_SOURCE},
Hans Verkuil2b177f22019-03-05 03:36:20 -0500354 &vimc_sen_int_ops, &vimc_sen_ops);
Helen Koikef2fe8902017-04-07 14:55:19 -0300355 if (ret)
Hans Verkuil52cf1d92017-11-06 05:20:01 -0500356 goto err_free_hdl;
Helen Koikef2fe8902017-04-07 14:55:19 -0300357
Lucas A. M. Magalhãesadc589d2019-01-21 20:05:01 -0500358 vsen->ved.process_frame = vimc_sen_process_frame;
Helen Fornazier4a29b702017-06-19 14:00:18 -0300359 dev_set_drvdata(comp, &vsen->ved);
360 vsen->dev = comp;
361
Helen Fornazier88ad71a2017-06-19 14:00:16 -0300362 /* Initialize the frame format */
363 vsen->mbus_format = fmt_default;
Helen Koikef2fe8902017-04-07 14:55:19 -0300364
Helen Fornazier554946c2017-06-19 14:00:10 -0300365 /* Initialize the test pattern generator */
366 tpg_init(&vsen->tpg, vsen->mbus_format.width,
367 vsen->mbus_format.height);
Helen Fornazier88ad71a2017-06-19 14:00:16 -0300368 ret = tpg_alloc(&vsen->tpg, VIMC_FRAME_MAX_WIDTH);
Helen Fornazier554946c2017-06-19 14:00:10 -0300369 if (ret)
Helen Fornazierc1495432017-06-19 14:00:12 -0300370 goto err_unregister_ent_sd;
Helen Koikef2fe8902017-04-07 14:55:19 -0300371
Helen Fornazier4a29b702017-06-19 14:00:18 -0300372 return 0;
Helen Koikef2fe8902017-04-07 14:55:19 -0300373
Helen Fornazierc1495432017-06-19 14:00:12 -0300374err_unregister_ent_sd:
375 vimc_ent_sd_unregister(&vsen->ved, &vsen->sd);
Hans Verkuil52cf1d92017-11-06 05:20:01 -0500376err_free_hdl:
377 v4l2_ctrl_handler_free(&vsen->hdl);
Helen Koikef2fe8902017-04-07 14:55:19 -0300378err_free_vsen:
379 kfree(vsen);
380
Helen Fornazier4a29b702017-06-19 14:00:18 -0300381 return ret;
Helen Koikef2fe8902017-04-07 14:55:19 -0300382}
Helen Fornazier4a29b702017-06-19 14:00:18 -0300383
384static const struct component_ops vimc_sen_comp_ops = {
385 .bind = vimc_sen_comp_bind,
386 .unbind = vimc_sen_comp_unbind,
387};
388
389static int vimc_sen_probe(struct platform_device *pdev)
390{
391 return component_add(&pdev->dev, &vimc_sen_comp_ops);
392}
393
394static int vimc_sen_remove(struct platform_device *pdev)
395{
396 component_del(&pdev->dev, &vimc_sen_comp_ops);
397
398 return 0;
399}
400
Helen Fornazier4a29b702017-06-19 14:00:18 -0300401static const struct platform_device_id vimc_sen_driver_ids[] = {
402 {
403 .name = VIMC_SEN_DRV_NAME,
404 },
405 { }
406};
407
Javier Martinez Canillasbb3abbb2017-07-14 05:58:39 -0300408static struct platform_driver vimc_sen_pdrv = {
409 .probe = vimc_sen_probe,
410 .remove = vimc_sen_remove,
411 .id_table = vimc_sen_driver_ids,
412 .driver = {
413 .name = VIMC_SEN_DRV_NAME,
414 },
415};
416
Helen Fornazier4a29b702017-06-19 14:00:18 -0300417module_platform_driver(vimc_sen_pdrv);
418
419MODULE_DEVICE_TABLE(platform, vimc_sen_driver_ids);
420
421MODULE_DESCRIPTION("Virtual Media Controller Driver (VIMC) Sensor");
422MODULE_AUTHOR("Helen Mae Koike Fornazier <helen.fornazier@gmail.com>");
423MODULE_LICENSE("GPL");