blob: 081e54204c9f4ece6616c12c37fc28c38c25ca01 [file] [log] [blame]
Helen Koikef2fe8902017-04-07 14:55:19 -03001/*
2 * vimc-sensor.c Virtual Media Controller Driver
3 *
4 * Copyright (C) 2015-2017 Helen Koike <helen.fornazier@gmail.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; 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 * GNU General Public License for more details.
15 *
16 */
17
Helen Fornazier4a29b702017-06-19 14:00:18 -030018#include <linux/component.h>
Helen Fornazier4a29b702017-06-19 14:00:18 -030019#include <linux/module.h>
Randy Dunlapac316722018-06-19 22:47:28 -070020#include <linux/mod_devicetable.h>
Helen Fornazier4a29b702017-06-19 14:00:18 -030021#include <linux/platform_device.h>
Helen Koikef2fe8902017-04-07 14:55:19 -030022#include <linux/v4l2-mediabus.h>
23#include <linux/vmalloc.h>
Hans Verkuil52cf1d92017-11-06 05:20:01 -050024#include <media/v4l2-ctrls.h>
Hans Verkuil3da7ee92018-02-02 08:00:32 -050025#include <media/v4l2-event.h>
Helen Koikef2fe8902017-04-07 14:55:19 -030026#include <media/v4l2-subdev.h>
Mauro Carvalho Chehab1beb6232017-10-09 06:02:25 -040027#include <media/tpg/v4l2-tpg.h>
Helen Koikef2fe8902017-04-07 14:55:19 -030028
Helen Fornazier4a29b702017-06-19 14:00:18 -030029#include "vimc-common.h"
30
31#define VIMC_SEN_DRV_NAME "vimc-sensor"
Helen Koikef2fe8902017-04-07 14:55:19 -030032
33struct vimc_sen_device {
34 struct vimc_ent_device ved;
35 struct v4l2_subdev sd;
Helen Fornazier4a29b702017-06-19 14:00:18 -030036 struct device *dev;
Helen Fornazier554946c2017-06-19 14:00:10 -030037 struct tpg_data tpg;
Helen Koikef2fe8902017-04-07 14:55:19 -030038 struct task_struct *kthread_sen;
39 u8 *frame;
40 /* The active format */
41 struct v4l2_mbus_framefmt mbus_format;
Hans Verkuil52cf1d92017-11-06 05:20:01 -050042 struct v4l2_ctrl_handler hdl;
Helen Koikef2fe8902017-04-07 14:55:19 -030043};
44
Helen Fornazier88ad71a2017-06-19 14:00:16 -030045static const struct v4l2_mbus_framefmt fmt_default = {
46 .width = 640,
47 .height = 480,
48 .code = MEDIA_BUS_FMT_RGB888_1X24,
49 .field = V4L2_FIELD_NONE,
50 .colorspace = V4L2_COLORSPACE_DEFAULT,
51};
52
53static int vimc_sen_init_cfg(struct v4l2_subdev *sd,
54 struct v4l2_subdev_pad_config *cfg)
55{
56 unsigned int i;
57
58 for (i = 0; i < sd->entity.num_pads; i++) {
59 struct v4l2_mbus_framefmt *mf;
60
61 mf = v4l2_subdev_get_try_format(sd, cfg, i);
62 *mf = fmt_default;
63 }
64
65 return 0;
66}
67
Helen Koikef2fe8902017-04-07 14:55:19 -030068static int vimc_sen_enum_frame_size(struct v4l2_subdev *sd,
69 struct v4l2_subdev_pad_config *cfg,
70 struct v4l2_subdev_frame_size_enum *fse)
71{
Helen Koikef2fe8902017-04-07 14:55:19 -030072 if (fse->index)
73 return -EINVAL;
74
Helen Fornazier88ad71a2017-06-19 14:00:16 -030075 fse->min_width = VIMC_FRAME_MIN_WIDTH;
76 fse->max_width = VIMC_FRAME_MAX_WIDTH;
77 fse->min_height = VIMC_FRAME_MIN_HEIGHT;
78 fse->max_height = VIMC_FRAME_MAX_HEIGHT;
Helen Koikef2fe8902017-04-07 14:55:19 -030079
80 return 0;
81}
82
83static int vimc_sen_get_fmt(struct v4l2_subdev *sd,
84 struct v4l2_subdev_pad_config *cfg,
Helen Fornazier88ad71a2017-06-19 14:00:16 -030085 struct v4l2_subdev_format *fmt)
Helen Koikef2fe8902017-04-07 14:55:19 -030086{
87 struct vimc_sen_device *vsen =
88 container_of(sd, struct vimc_sen_device, sd);
89
Helen Fornazier88ad71a2017-06-19 14:00:16 -030090 fmt->format = fmt->which == V4L2_SUBDEV_FORMAT_TRY ?
91 *v4l2_subdev_get_try_format(sd, cfg, fmt->pad) :
92 vsen->mbus_format;
Helen Koikef2fe8902017-04-07 14:55:19 -030093
94 return 0;
95}
96
Helen Fornazier554946c2017-06-19 14:00:10 -030097static void vimc_sen_tpg_s_format(struct vimc_sen_device *vsen)
98{
Helen Fornazierb6c61a62019-03-13 14:29:37 -040099 u32 pixelformat = vsen->ved.stream->producer_pixfmt;
100 const struct v4l2_format_info *pix_info;
101
102 pix_info = v4l2_format_info(pixelformat);
Helen Fornazier554946c2017-06-19 14:00:10 -0300103
104 tpg_reset_source(&vsen->tpg, vsen->mbus_format.width,
105 vsen->mbus_format.height, vsen->mbus_format.field);
Helen Fornazierb6c61a62019-03-13 14:29:37 -0400106 tpg_s_bytesperline(&vsen->tpg, 0,
107 vsen->mbus_format.width * pix_info->bpp[0]);
Helen Fornazier554946c2017-06-19 14:00:10 -0300108 tpg_s_buf_height(&vsen->tpg, vsen->mbus_format.height);
Helen Fornazierb6c61a62019-03-13 14:29:37 -0400109 tpg_s_fourcc(&vsen->tpg, pixelformat);
Helen Fornazier554946c2017-06-19 14:00:10 -0300110 /* TODO: add support for V4L2_FIELD_ALTERNATE */
111 tpg_s_field(&vsen->tpg, vsen->mbus_format.field, false);
112 tpg_s_colorspace(&vsen->tpg, vsen->mbus_format.colorspace);
113 tpg_s_ycbcr_enc(&vsen->tpg, vsen->mbus_format.ycbcr_enc);
114 tpg_s_quantization(&vsen->tpg, vsen->mbus_format.quantization);
115 tpg_s_xfer_func(&vsen->tpg, vsen->mbus_format.xfer_func);
116}
117
Helen Fornazier88ad71a2017-06-19 14:00:16 -0300118static void vimc_sen_adjust_fmt(struct v4l2_mbus_framefmt *fmt)
119{
Helen Fornazier88ad71a2017-06-19 14:00:16 -0300120 fmt->width = clamp_t(u32, fmt->width, VIMC_FRAME_MIN_WIDTH,
121 VIMC_FRAME_MAX_WIDTH) & ~1;
122 fmt->height = clamp_t(u32, fmt->height, VIMC_FRAME_MIN_HEIGHT,
123 VIMC_FRAME_MAX_HEIGHT) & ~1;
124
125 /* TODO: add support for V4L2_FIELD_ALTERNATE */
126 if (fmt->field == V4L2_FIELD_ANY || fmt->field == V4L2_FIELD_ALTERNATE)
127 fmt->field = fmt_default.field;
128
129 vimc_colorimetry_clamp(fmt);
130}
131
132static int vimc_sen_set_fmt(struct v4l2_subdev *sd,
133 struct v4l2_subdev_pad_config *cfg,
134 struct v4l2_subdev_format *fmt)
135{
136 struct vimc_sen_device *vsen = v4l2_get_subdevdata(sd);
137 struct v4l2_mbus_framefmt *mf;
138
Helen Fornazierb6c61a62019-03-13 14:29:37 -0400139 if (!vimc_mbus_code_supported(fmt->format.code))
140 fmt->format.code = fmt_default.code;
141
Helen Fornazier88ad71a2017-06-19 14:00:16 -0300142 if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) {
143 /* Do not change the format while stream is on */
144 if (vsen->frame)
145 return -EBUSY;
146
147 mf = &vsen->mbus_format;
148 } else {
149 mf = v4l2_subdev_get_try_format(sd, cfg, fmt->pad);
150 }
151
152 /* Set the new format */
153 vimc_sen_adjust_fmt(&fmt->format);
154
Helen Fornazier4a29b702017-06-19 14:00:18 -0300155 dev_dbg(vsen->dev, "%s: format update: "
Helen Fornazier88ad71a2017-06-19 14:00:16 -0300156 "old:%dx%d (0x%x, %d, %d, %d, %d) "
157 "new:%dx%d (0x%x, %d, %d, %d, %d)\n", vsen->sd.name,
158 /* old */
159 mf->width, mf->height, mf->code,
160 mf->colorspace, mf->quantization,
161 mf->xfer_func, mf->ycbcr_enc,
162 /* new */
163 fmt->format.width, fmt->format.height, fmt->format.code,
164 fmt->format.colorspace, fmt->format.quantization,
165 fmt->format.xfer_func, fmt->format.ycbcr_enc);
166
167 *mf = fmt->format;
168
169 return 0;
170}
171
Helen Koikef2fe8902017-04-07 14:55:19 -0300172static const struct v4l2_subdev_pad_ops vimc_sen_pad_ops = {
Helen Fornazier88ad71a2017-06-19 14:00:16 -0300173 .init_cfg = vimc_sen_init_cfg,
Helen Fornazierb6c61a62019-03-13 14:29:37 -0400174 .enum_mbus_code = vimc_enum_mbus_code,
Helen Koikef2fe8902017-04-07 14:55:19 -0300175 .enum_frame_size = vimc_sen_enum_frame_size,
176 .get_fmt = vimc_sen_get_fmt,
Helen Fornazier88ad71a2017-06-19 14:00:16 -0300177 .set_fmt = vimc_sen_set_fmt,
Helen Koikef2fe8902017-04-07 14:55:19 -0300178};
179
Lucas A. M. Magalhãesadc589d2019-01-21 20:05:01 -0500180static void *vimc_sen_process_frame(struct vimc_ent_device *ved,
181 const void *sink_frame)
Helen Koikef2fe8902017-04-07 14:55:19 -0300182{
Lucas A. M. Magalhãesadc589d2019-01-21 20:05:01 -0500183 struct vimc_sen_device *vsen = container_of(ved, struct vimc_sen_device,
184 ved);
Helen Koikef2fe8902017-04-07 14:55:19 -0300185
Lucas A. M. Magalhãesadc589d2019-01-21 20:05:01 -0500186 tpg_fill_plane_buffer(&vsen->tpg, 0, 0, vsen->frame);
187 return vsen->frame;
Helen Koikef2fe8902017-04-07 14:55:19 -0300188}
189
190static int vimc_sen_s_stream(struct v4l2_subdev *sd, int enable)
191{
192 struct vimc_sen_device *vsen =
193 container_of(sd, struct vimc_sen_device, sd);
Helen Koikef2fe8902017-04-07 14:55:19 -0300194
195 if (enable) {
Helen Fornazierb6c61a62019-03-13 14:29:37 -0400196 u32 pixelformat = vsen->ved.stream->producer_pixfmt;
197 const struct v4l2_format_info *pix_info;
Helen Fornazier554946c2017-06-19 14:00:10 -0300198 unsigned int frame_size;
Helen Koikef2fe8902017-04-07 14:55:19 -0300199
200 if (vsen->kthread_sen)
Helen Fornazier554946c2017-06-19 14:00:10 -0300201 /* tpg is already executing */
202 return 0;
Helen Koikef2fe8902017-04-07 14:55:19 -0300203
204 /* Calculate the frame size */
Helen Fornazierb6c61a62019-03-13 14:29:37 -0400205 pix_info = v4l2_format_info(pixelformat);
206 frame_size = vsen->mbus_format.width * pix_info->bpp[0] *
Helen Fornazier554946c2017-06-19 14:00:10 -0300207 vsen->mbus_format.height;
Helen Koikef2fe8902017-04-07 14:55:19 -0300208
209 /*
210 * Allocate the frame buffer. Use vmalloc to be able to
211 * allocate a large amount of memory
212 */
Helen Fornazier554946c2017-06-19 14:00:10 -0300213 vsen->frame = vmalloc(frame_size);
Helen Koikef2fe8902017-04-07 14:55:19 -0300214 if (!vsen->frame)
215 return -ENOMEM;
216
Helen Fornazier554946c2017-06-19 14:00:10 -0300217 /* configure the test pattern generator */
218 vimc_sen_tpg_s_format(vsen);
219
Helen Koikef2fe8902017-04-07 14:55:19 -0300220 } else {
Helen Koikef2fe8902017-04-07 14:55:19 -0300221
Helen Koikef2fe8902017-04-07 14:55:19 -0300222 vfree(vsen->frame);
223 vsen->frame = NULL;
Helen Fornazier554946c2017-06-19 14:00:10 -0300224 return 0;
Helen Koikef2fe8902017-04-07 14:55:19 -0300225 }
226
227 return 0;
228}
229
Julia Lawallda411ab2018-10-27 08:49:05 -0400230static const struct v4l2_subdev_core_ops vimc_sen_core_ops = {
Hans Verkuil3da7ee92018-02-02 08:00:32 -0500231 .log_status = v4l2_ctrl_subdev_log_status,
232 .subscribe_event = v4l2_ctrl_subdev_subscribe_event,
233 .unsubscribe_event = v4l2_event_subdev_unsubscribe,
234};
235
Julia Lawallebf7a642017-08-08 06:58:28 -0400236static const struct v4l2_subdev_video_ops vimc_sen_video_ops = {
Helen Koikef2fe8902017-04-07 14:55:19 -0300237 .s_stream = vimc_sen_s_stream,
238};
239
240static const struct v4l2_subdev_ops vimc_sen_ops = {
Hans Verkuil3da7ee92018-02-02 08:00:32 -0500241 .core = &vimc_sen_core_ops,
Helen Koikef2fe8902017-04-07 14:55:19 -0300242 .pad = &vimc_sen_pad_ops,
243 .video = &vimc_sen_video_ops,
244};
245
Hans Verkuil52cf1d92017-11-06 05:20:01 -0500246static int vimc_sen_s_ctrl(struct v4l2_ctrl *ctrl)
247{
248 struct vimc_sen_device *vsen =
249 container_of(ctrl->handler, struct vimc_sen_device, hdl);
250
251 switch (ctrl->id) {
252 case VIMC_CID_TEST_PATTERN:
253 tpg_s_pattern(&vsen->tpg, ctrl->val);
254 break;
255 case V4L2_CID_HFLIP:
256 tpg_s_hflip(&vsen->tpg, ctrl->val);
257 break;
258 case V4L2_CID_VFLIP:
259 tpg_s_vflip(&vsen->tpg, ctrl->val);
260 break;
Guilherme Gallo7b0bfa52018-09-03 21:45:59 -0400261 case V4L2_CID_BRIGHTNESS:
262 tpg_s_brightness(&vsen->tpg, ctrl->val);
263 break;
264 case V4L2_CID_CONTRAST:
265 tpg_s_contrast(&vsen->tpg, ctrl->val);
266 break;
267 case V4L2_CID_HUE:
268 tpg_s_hue(&vsen->tpg, ctrl->val);
269 break;
270 case V4L2_CID_SATURATION:
271 tpg_s_saturation(&vsen->tpg, ctrl->val);
272 break;
Hans Verkuil52cf1d92017-11-06 05:20:01 -0500273 default:
274 return -EINVAL;
275 }
276 return 0;
277}
278
279static const struct v4l2_ctrl_ops vimc_sen_ctrl_ops = {
280 .s_ctrl = vimc_sen_s_ctrl,
281};
282
Hans Verkuil2b177f22019-03-05 03:36:20 -0500283static void vimc_sen_release(struct v4l2_subdev *sd)
284{
285 struct vimc_sen_device *vsen =
286 container_of(sd, struct vimc_sen_device, sd);
287
288 v4l2_ctrl_handler_free(&vsen->hdl);
289 tpg_free(&vsen->tpg);
290 kfree(vsen);
291}
292
293static const struct v4l2_subdev_internal_ops vimc_sen_int_ops = {
294 .release = vimc_sen_release,
295};
296
Helen Fornazier4a29b702017-06-19 14:00:18 -0300297static void vimc_sen_comp_unbind(struct device *comp, struct device *master,
298 void *master_data)
Helen Koikef2fe8902017-04-07 14:55:19 -0300299{
Helen Fornazier4a29b702017-06-19 14:00:18 -0300300 struct vimc_ent_device *ved = dev_get_drvdata(comp);
Helen Koikef2fe8902017-04-07 14:55:19 -0300301 struct vimc_sen_device *vsen =
302 container_of(ved, struct vimc_sen_device, ved);
303
Helen Fornazierc1495432017-06-19 14:00:12 -0300304 vimc_ent_sd_unregister(ved, &vsen->sd);
Helen Koikef2fe8902017-04-07 14:55:19 -0300305}
306
Hans Verkuil52cf1d92017-11-06 05:20:01 -0500307/* Image Processing Controls */
308static const struct v4l2_ctrl_config vimc_sen_ctrl_class = {
309 .flags = V4L2_CTRL_FLAG_READ_ONLY | V4L2_CTRL_FLAG_WRITE_ONLY,
310 .id = VIMC_CID_VIMC_CLASS,
311 .name = "VIMC Controls",
312 .type = V4L2_CTRL_TYPE_CTRL_CLASS,
313};
314
315static const struct v4l2_ctrl_config vimc_sen_ctrl_test_pattern = {
316 .ops = &vimc_sen_ctrl_ops,
317 .id = VIMC_CID_TEST_PATTERN,
318 .name = "Test Pattern",
319 .type = V4L2_CTRL_TYPE_MENU,
320 .max = TPG_PAT_NOISE,
321 .qmenu = tpg_pattern_strings,
322};
323
Helen Fornazier4a29b702017-06-19 14:00:18 -0300324static int vimc_sen_comp_bind(struct device *comp, struct device *master,
325 void *master_data)
Helen Koikef2fe8902017-04-07 14:55:19 -0300326{
Helen Fornazier4a29b702017-06-19 14:00:18 -0300327 struct v4l2_device *v4l2_dev = master_data;
328 struct vimc_platform_data *pdata = comp->platform_data;
Helen Koikef2fe8902017-04-07 14:55:19 -0300329 struct vimc_sen_device *vsen;
Helen Koikef2fe8902017-04-07 14:55:19 -0300330 int ret;
331
Helen Koikef2fe8902017-04-07 14:55:19 -0300332 /* Allocate the vsen struct */
333 vsen = kzalloc(sizeof(*vsen), GFP_KERNEL);
334 if (!vsen)
Helen Fornazier4a29b702017-06-19 14:00:18 -0300335 return -ENOMEM;
Helen Koikef2fe8902017-04-07 14:55:19 -0300336
Hans Verkuil52cf1d92017-11-06 05:20:01 -0500337 v4l2_ctrl_handler_init(&vsen->hdl, 4);
338
339 v4l2_ctrl_new_custom(&vsen->hdl, &vimc_sen_ctrl_class, NULL);
340 v4l2_ctrl_new_custom(&vsen->hdl, &vimc_sen_ctrl_test_pattern, NULL);
341 v4l2_ctrl_new_std(&vsen->hdl, &vimc_sen_ctrl_ops,
342 V4L2_CID_VFLIP, 0, 1, 1, 0);
343 v4l2_ctrl_new_std(&vsen->hdl, &vimc_sen_ctrl_ops,
344 V4L2_CID_HFLIP, 0, 1, 1, 0);
Guilherme Gallo7b0bfa52018-09-03 21:45:59 -0400345 v4l2_ctrl_new_std(&vsen->hdl, &vimc_sen_ctrl_ops,
346 V4L2_CID_BRIGHTNESS, 0, 255, 1, 128);
347 v4l2_ctrl_new_std(&vsen->hdl, &vimc_sen_ctrl_ops,
348 V4L2_CID_CONTRAST, 0, 255, 1, 128);
349 v4l2_ctrl_new_std(&vsen->hdl, &vimc_sen_ctrl_ops,
350 V4L2_CID_HUE, -128, 127, 1, 0);
351 v4l2_ctrl_new_std(&vsen->hdl, &vimc_sen_ctrl_ops,
352 V4L2_CID_SATURATION, 0, 255, 1, 128);
Hans Verkuil52cf1d92017-11-06 05:20:01 -0500353 vsen->sd.ctrl_handler = &vsen->hdl;
354 if (vsen->hdl.error) {
355 ret = vsen->hdl.error;
356 goto err_free_vsen;
357 }
358
Helen Fornazierc1495432017-06-19 14:00:12 -0300359 /* Initialize ved and sd */
Helen Fornazier4a29b702017-06-19 14:00:18 -0300360 ret = vimc_ent_sd_register(&vsen->ved, &vsen->sd, v4l2_dev,
361 pdata->entity_name,
Hans Verkuil1ceda322018-02-07 12:06:30 -0500362 MEDIA_ENT_F_CAM_SENSOR, 1,
Helen Fornazier4a29b702017-06-19 14:00:18 -0300363 (const unsigned long[1]) {MEDIA_PAD_FL_SOURCE},
Hans Verkuil2b177f22019-03-05 03:36:20 -0500364 &vimc_sen_int_ops, &vimc_sen_ops);
Helen Koikef2fe8902017-04-07 14:55:19 -0300365 if (ret)
Hans Verkuil52cf1d92017-11-06 05:20:01 -0500366 goto err_free_hdl;
Helen Koikef2fe8902017-04-07 14:55:19 -0300367
Lucas A. M. Magalhãesadc589d2019-01-21 20:05:01 -0500368 vsen->ved.process_frame = vimc_sen_process_frame;
Helen Fornazier4a29b702017-06-19 14:00:18 -0300369 dev_set_drvdata(comp, &vsen->ved);
370 vsen->dev = comp;
371
Helen Fornazier88ad71a2017-06-19 14:00:16 -0300372 /* Initialize the frame format */
373 vsen->mbus_format = fmt_default;
Helen Koikef2fe8902017-04-07 14:55:19 -0300374
Helen Fornazier554946c2017-06-19 14:00:10 -0300375 /* Initialize the test pattern generator */
376 tpg_init(&vsen->tpg, vsen->mbus_format.width,
377 vsen->mbus_format.height);
Helen Fornazier88ad71a2017-06-19 14:00:16 -0300378 ret = tpg_alloc(&vsen->tpg, VIMC_FRAME_MAX_WIDTH);
Helen Fornazier554946c2017-06-19 14:00:10 -0300379 if (ret)
Helen Fornazierc1495432017-06-19 14:00:12 -0300380 goto err_unregister_ent_sd;
Helen Koikef2fe8902017-04-07 14:55:19 -0300381
Helen Fornazier4a29b702017-06-19 14:00:18 -0300382 return 0;
Helen Koikef2fe8902017-04-07 14:55:19 -0300383
Helen Fornazierc1495432017-06-19 14:00:12 -0300384err_unregister_ent_sd:
385 vimc_ent_sd_unregister(&vsen->ved, &vsen->sd);
Hans Verkuil52cf1d92017-11-06 05:20:01 -0500386err_free_hdl:
387 v4l2_ctrl_handler_free(&vsen->hdl);
Helen Koikef2fe8902017-04-07 14:55:19 -0300388err_free_vsen:
389 kfree(vsen);
390
Helen Fornazier4a29b702017-06-19 14:00:18 -0300391 return ret;
Helen Koikef2fe8902017-04-07 14:55:19 -0300392}
Helen Fornazier4a29b702017-06-19 14:00:18 -0300393
394static const struct component_ops vimc_sen_comp_ops = {
395 .bind = vimc_sen_comp_bind,
396 .unbind = vimc_sen_comp_unbind,
397};
398
399static int vimc_sen_probe(struct platform_device *pdev)
400{
401 return component_add(&pdev->dev, &vimc_sen_comp_ops);
402}
403
404static int vimc_sen_remove(struct platform_device *pdev)
405{
406 component_del(&pdev->dev, &vimc_sen_comp_ops);
407
408 return 0;
409}
410
Helen Fornazier4a29b702017-06-19 14:00:18 -0300411static const struct platform_device_id vimc_sen_driver_ids[] = {
412 {
413 .name = VIMC_SEN_DRV_NAME,
414 },
415 { }
416};
417
Javier Martinez Canillasbb3abbb2017-07-14 05:58:39 -0300418static struct platform_driver vimc_sen_pdrv = {
419 .probe = vimc_sen_probe,
420 .remove = vimc_sen_remove,
421 .id_table = vimc_sen_driver_ids,
422 .driver = {
423 .name = VIMC_SEN_DRV_NAME,
424 },
425};
426
Helen Fornazier4a29b702017-06-19 14:00:18 -0300427module_platform_driver(vimc_sen_pdrv);
428
429MODULE_DEVICE_TABLE(platform, vimc_sen_driver_ids);
430
431MODULE_DESCRIPTION("Virtual Media Controller Driver (VIMC) Sensor");
432MODULE_AUTHOR("Helen Mae Koike Fornazier <helen.fornazier@gmail.com>");
433MODULE_LICENSE("GPL");