Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] marvell-ccic: remove g_chip_ident

Remove g_chip_ident. This driver used some of the V4L2_IDENT defines, replace
those with a driver-specific enum. This makes it possible to drop the
v4l2-chip-ident.h define as well.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

authored by

Hans Verkuil and committed by
Mauro Carvalho Chehab
7486af1a 08fe9f7d

+16 -53
+1 -2
drivers/media/platform/marvell-ccic/cafe-driver.c
··· 27 27 #include <linux/slab.h> 28 28 #include <linux/videodev2.h> 29 29 #include <media/v4l2-device.h> 30 - #include <media/v4l2-chip-ident.h> 31 30 #include <linux/device.h> 32 31 #include <linux/wait.h> 33 32 #include <linux/delay.h> ··· 468 469 goto out; 469 470 cam->pdev = pdev; 470 471 mcam = &cam->mcam; 471 - mcam->chip_id = V4L2_IDENT_CAFE; 472 + mcam->chip_id = MCAM_CAFE; 472 473 spin_lock_init(&mcam->dev_lock); 473 474 init_waitqueue_head(&cam->smbus_wait); 474 475 mcam->plat_power_up = cafe_ctlr_power_up;
+8 -47
drivers/media/platform/marvell-ccic/mcam-core.c
··· 23 23 #include <media/v4l2-device.h> 24 24 #include <media/v4l2-ioctl.h> 25 25 #include <media/v4l2-ctrls.h> 26 - #include <media/v4l2-chip-ident.h> 27 26 #include <media/ov7670.h> 28 27 #include <media/videobuf2-vmalloc.h> 29 28 #include <media/videobuf2-dma-contig.h> ··· 335 336 mcam_reg_clear_bit(cam, REG_CTRL1, C1_TWOBUFS); 336 337 } else 337 338 mcam_reg_set_bit(cam, REG_CTRL1, C1_TWOBUFS); 338 - if (cam->chip_id == V4L2_IDENT_CAFE) 339 + if (cam->chip_id == MCAM_CAFE) 339 340 mcam_reg_write(cam, REG_UBAR, 0); /* 32 bits only */ 340 341 } 341 342 ··· 795 796 */ 796 797 static int mcam_cam_init(struct mcam_camera *cam) 797 798 { 798 - struct v4l2_dbg_chip_ident chip; 799 799 int ret; 800 800 801 801 mutex_lock(&cam->s_mutex); ··· 802 804 cam_warn(cam, "Cam init with device in funky state %d", 803 805 cam->state); 804 806 ret = __mcam_cam_reset(cam); 805 - if (ret) 806 - goto out; 807 - chip.ident = V4L2_IDENT_NONE; 808 - chip.match.type = V4L2_CHIP_MATCH_I2C_ADDR; 809 - chip.match.addr = cam->sensor_addr; 810 - ret = sensor_call(cam, core, g_chip_ident, &chip); 811 - if (ret) 812 - goto out; 813 - cam->sensor_type = chip.ident; 814 - if (cam->sensor_type != V4L2_IDENT_OV7670) { 815 - cam_err(cam, "Unsupported sensor type 0x%x", cam->sensor_type); 816 - ret = -EINVAL; 817 - goto out; 818 - } 819 - /* Get/set parameters? */ 820 - ret = 0; 807 + /* Get/set parameters? */ 821 808 cam->state = S_IDLE; 822 - out: 823 809 mcam_ctlr_power_down(cam); 824 810 mutex_unlock(&cam->s_mutex); 825 811 return ret; ··· 1374 1392 return ret; 1375 1393 } 1376 1394 1377 - static int mcam_vidioc_g_chip_ident(struct file *file, void *priv, 1378 - struct v4l2_dbg_chip_ident *chip) 1379 - { 1380 - struct mcam_camera *cam = priv; 1381 - 1382 - chip->ident = V4L2_IDENT_NONE; 1383 - chip->revision = 0; 1384 - if (v4l2_chip_match_host(&chip->match)) { 1385 - chip->ident = cam->chip_id; 1386 - return 0; 1387 - } 1388 - return sensor_call(cam, core, g_chip_ident, chip); 1389 - } 1390 - 1391 1395 static int mcam_vidioc_enum_framesizes(struct file *filp, void *priv, 1392 1396 struct v4l2_frmsizeenum *sizes) 1393 1397 { ··· 1404 1436 { 1405 1437 struct mcam_camera *cam = priv; 1406 1438 1407 - if (v4l2_chip_match_host(&reg->match)) { 1408 - reg->val = mcam_reg_read(cam, reg->reg); 1409 - reg->size = 4; 1410 - return 0; 1411 - } 1412 - return sensor_call(cam, core, g_register, reg); 1439 + reg->val = mcam_reg_read(cam, reg->reg); 1440 + reg->size = 4; 1441 + return 0; 1413 1442 } 1414 1443 1415 1444 static int mcam_vidioc_s_register(struct file *file, void *priv, ··· 1414 1449 { 1415 1450 struct mcam_camera *cam = priv; 1416 1451 1417 - if (v4l2_chip_match_host(&reg->match)) { 1418 - mcam_reg_write(cam, reg->reg, reg->val); 1419 - return 0; 1420 - } 1421 - return sensor_call(cam, core, s_register, reg); 1452 + mcam_reg_write(cam, reg->reg, reg->val); 1453 + return 0; 1422 1454 } 1423 1455 #endif 1424 1456 ··· 1439 1477 .vidioc_s_parm = mcam_vidioc_s_parm, 1440 1478 .vidioc_enum_framesizes = mcam_vidioc_enum_framesizes, 1441 1479 .vidioc_enum_frameintervals = mcam_vidioc_enum_frameintervals, 1442 - .vidioc_g_chip_ident = mcam_vidioc_g_chip_ident, 1443 1480 #ifdef CONFIG_VIDEO_ADV_DEBUG 1444 1481 .vidioc_g_register = mcam_vidioc_g_register, 1445 1482 .vidioc_s_register = mcam_vidioc_s_register, ··· 1656 1695 if (buffer_mode >= 0) 1657 1696 cam->buffer_mode = buffer_mode; 1658 1697 if (cam->buffer_mode == B_DMA_sg && 1659 - cam->chip_id == V4L2_IDENT_CAFE) { 1698 + cam->chip_id == MCAM_CAFE) { 1660 1699 printk(KERN_ERR "marvell-cam: Cafe can't do S/G I/O, " 1661 1700 "attempting vmalloc mode instead\n"); 1662 1701 cam->buffer_mode = B_vmalloc;
+6 -2
drivers/media/platform/marvell-ccic/mcam-core.h
··· 53 53 B_DMA_sg = 2 54 54 }; 55 55 56 + enum mcam_chip_id { 57 + MCAM_CAFE, 58 + MCAM_ARMADA610, 59 + }; 60 + 56 61 /* 57 62 * Is a given buffer mode supported by the current kernel configuration? 58 63 */ ··· 103 98 unsigned char __iomem *regs; 104 99 spinlock_t dev_lock; 105 100 struct device *dev; /* For messages, dma alloc */ 106 - unsigned int chip_id; 101 + enum mcam_chip_id chip_id; 107 102 short int clock_speed; /* Sensor clock speed, default 30 */ 108 103 short int use_smbus; /* SMBUS or straight I2c? */ 109 104 enum mcam_buffer_mode buffer_mode; ··· 157 152 void (*frame_complete)(struct mcam_camera *cam, int frame); 158 153 159 154 /* Current operating parameters */ 160 - u32 sensor_type; /* Currently ov7670 only */ 161 155 struct v4l2_pix_format pix_format; 162 156 enum v4l2_mbus_pixelcode mbus_code; 163 157
+1 -2
drivers/media/platform/marvell-ccic/mmp-driver.c
··· 18 18 #include <linux/slab.h> 19 19 #include <linux/videodev2.h> 20 20 #include <media/v4l2-device.h> 21 - #include <media/v4l2-chip-ident.h> 22 21 #include <media/mmp-camera.h> 23 22 #include <linux/device.h> 24 23 #include <linux/platform_device.h> ··· 184 185 mcam->plat_power_down = mmpcam_power_down; 185 186 mcam->dev = &pdev->dev; 186 187 mcam->use_smbus = 0; 187 - mcam->chip_id = V4L2_IDENT_ARMADA610; 188 + mcam->chip_id = MCAM_ARMADA610; 188 189 mcam->buffer_mode = B_DMA_sg; 189 190 spin_lock_init(&mcam->dev_lock); 190 191 /*