aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2016-07-31 07:12:22 -0400
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-08-24 05:35:19 -0400
commitf304562ed3c97e237a77b3da57b0e43f264bd82a (patch)
tree5464da90804b1a655ffa054412d638dc120c369f
parent563bf7a72eac823b06953cd3dce9b71b499fa438 (diff)
[media] soc-camera/sh_mobile_csi2: remove unused driver
The sh_mobile_csi2 isn't used anymore (was it ever?), so remove it. Especially since the soc-camera framework is being deprecated. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
-rw-r--r--drivers/media/platform/soc_camera/Kconfig7
-rw-r--r--drivers/media/platform/soc_camera/Makefile1
-rw-r--r--drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c229
-rw-r--r--drivers/media/platform/soc_camera/sh_mobile_csi2.c400
-rw-r--r--include/media/drv-intf/sh_mobile_ceu.h1
-rw-r--r--include/media/drv-intf/sh_mobile_csi2.h48
6 files changed, 10 insertions, 676 deletions
diff --git a/drivers/media/platform/soc_camera/Kconfig b/drivers/media/platform/soc_camera/Kconfig
index 39f66414f621..99cf471a5fc0 100644
--- a/drivers/media/platform/soc_camera/Kconfig
+++ b/drivers/media/platform/soc_camera/Kconfig
@@ -35,13 +35,6 @@ config VIDEO_RCAR_VIN_OLD
35 ---help--- 35 ---help---
36 This is a v4l2 driver for the R-Car VIN Interface 36 This is a v4l2 driver for the R-Car VIN Interface
37 37
38config VIDEO_SH_MOBILE_CSI2
39 tristate "SuperH Mobile MIPI CSI-2 Interface driver"
40 depends on VIDEO_DEV && SOC_CAMERA && HAVE_CLK
41 depends on ARCH_SHMOBILE || SUPERH || COMPILE_TEST
42 ---help---
43 This is a v4l2 driver for the SuperH MIPI CSI-2 Interface
44
45config VIDEO_SH_MOBILE_CEU 38config VIDEO_SH_MOBILE_CEU
46 tristate "SuperH Mobile CEU Interface driver" 39 tristate "SuperH Mobile CEU Interface driver"
47 depends on VIDEO_DEV && SOC_CAMERA && HAS_DMA && HAVE_CLK 40 depends on VIDEO_DEV && SOC_CAMERA && HAS_DMA && HAVE_CLK
diff --git a/drivers/media/platform/soc_camera/Makefile b/drivers/media/platform/soc_camera/Makefile
index 7703cb7ce456..ee8f9a4ae2a4 100644
--- a/drivers/media/platform/soc_camera/Makefile
+++ b/drivers/media/platform/soc_camera/Makefile
@@ -9,5 +9,4 @@ obj-$(CONFIG_SOC_CAMERA_PLATFORM) += soc_camera_platform.o
9obj-$(CONFIG_VIDEO_ATMEL_ISI) += atmel-isi.o 9obj-$(CONFIG_VIDEO_ATMEL_ISI) += atmel-isi.o
10obj-$(CONFIG_VIDEO_PXA27x) += pxa_camera.o 10obj-$(CONFIG_VIDEO_PXA27x) += pxa_camera.o
11obj-$(CONFIG_VIDEO_SH_MOBILE_CEU) += sh_mobile_ceu_camera.o 11obj-$(CONFIG_VIDEO_SH_MOBILE_CEU) += sh_mobile_ceu_camera.o
12obj-$(CONFIG_VIDEO_SH_MOBILE_CSI2) += sh_mobile_csi2.o
13obj-$(CONFIG_VIDEO_RCAR_VIN_OLD) += rcar_vin.o 12obj-$(CONFIG_VIDEO_RCAR_VIN_OLD) += rcar_vin.o
diff --git a/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c b/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
index 02b519dde42a..05eafe3a421e 100644
--- a/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
+++ b/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
@@ -41,7 +41,6 @@
41#include <media/v4l2-dev.h> 41#include <media/v4l2-dev.h>
42#include <media/soc_camera.h> 42#include <media/soc_camera.h>
43#include <media/drv-intf/sh_mobile_ceu.h> 43#include <media/drv-intf/sh_mobile_ceu.h>
44#include <media/drv-intf/sh_mobile_csi2.h>
45#include <media/videobuf2-dma-contig.h> 44#include <media/videobuf2-dma-contig.h>
46#include <media/v4l2-mediabus.h> 45#include <media/v4l2-mediabus.h>
47#include <media/drv-intf/soc_mediabus.h> 46#include <media/drv-intf/soc_mediabus.h>
@@ -99,11 +98,6 @@ struct sh_mobile_ceu_buffer {
99 98
100struct sh_mobile_ceu_dev { 99struct sh_mobile_ceu_dev {
101 struct soc_camera_host ici; 100 struct soc_camera_host ici;
102 /* Asynchronous CSI2 linking */
103 struct v4l2_async_subdev *csi2_asd;
104 struct v4l2_subdev *csi2_sd;
105 /* Synchronous probing compatibility */
106 struct platform_device *csi2_pdev;
107 101
108 unsigned int irq; 102 unsigned int irq;
109 void __iomem *base; 103 void __iomem *base;
@@ -517,74 +511,20 @@ out:
517 return IRQ_HANDLED; 511 return IRQ_HANDLED;
518} 512}
519 513
520static struct v4l2_subdev *find_csi2(struct sh_mobile_ceu_dev *pcdev)
521{
522 struct v4l2_subdev *sd;
523
524 if (pcdev->csi2_sd)
525 return pcdev->csi2_sd;
526
527 if (pcdev->csi2_asd) {
528 char name[] = "sh-mobile-csi2";
529 v4l2_device_for_each_subdev(sd, &pcdev->ici.v4l2_dev)
530 if (!strncmp(name, sd->name, sizeof(name) - 1)) {
531 pcdev->csi2_sd = sd;
532 return sd;
533 }
534 }
535
536 return NULL;
537}
538
539static struct v4l2_subdev *csi2_subdev(struct sh_mobile_ceu_dev *pcdev,
540 struct soc_camera_device *icd)
541{
542 struct v4l2_subdev *sd = pcdev->csi2_sd;
543
544 return sd && sd->grp_id == soc_camera_grp_id(icd) ? sd : NULL;
545}
546
547static int sh_mobile_ceu_add_device(struct soc_camera_device *icd) 514static int sh_mobile_ceu_add_device(struct soc_camera_device *icd)
548{ 515{
549 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
550 struct sh_mobile_ceu_dev *pcdev = ici->priv;
551 struct v4l2_subdev *csi2_sd = find_csi2(pcdev);
552 int ret;
553
554 if (csi2_sd) {
555 csi2_sd->grp_id = soc_camera_grp_id(icd);
556 v4l2_set_subdev_hostdata(csi2_sd, icd);
557 }
558
559 ret = v4l2_subdev_call(csi2_sd, core, s_power, 1);
560 if (ret < 0 && ret != -ENOIOCTLCMD && ret != -ENODEV)
561 return ret;
562
563 /*
564 * -ENODEV is special: either csi2_sd == NULL or the CSI-2 driver
565 * has not found this soc-camera device among its clients
566 */
567 if (csi2_sd && ret == -ENODEV)
568 csi2_sd->grp_id = 0;
569
570 dev_info(icd->parent, 516 dev_info(icd->parent,
571 "SuperH Mobile CEU%s driver attached to camera %d\n", 517 "SuperH Mobile CEU driver attached to camera %d\n",
572 csi2_sd && csi2_sd->grp_id ? "/CSI-2" : "", icd->devnum); 518 icd->devnum);
573 519
574 return 0; 520 return 0;
575} 521}
576 522
577static void sh_mobile_ceu_remove_device(struct soc_camera_device *icd) 523static void sh_mobile_ceu_remove_device(struct soc_camera_device *icd)
578{ 524{
579 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
580 struct sh_mobile_ceu_dev *pcdev = ici->priv;
581 struct v4l2_subdev *csi2_sd = find_csi2(pcdev);
582
583 dev_info(icd->parent, 525 dev_info(icd->parent,
584 "SuperH Mobile CEU driver detached from camera %d\n", 526 "SuperH Mobile CEU driver detached from camera %d\n",
585 icd->devnum); 527 icd->devnum);
586
587 v4l2_subdev_call(csi2_sd, core, s_power, 0);
588} 528}
589 529
590/* Called with .host_lock held */ 530/* Called with .host_lock held */
@@ -704,12 +644,6 @@ static void sh_mobile_ceu_set_rect(struct soc_camera_device *icd)
704 cdwdr_width *= 2; 644 cdwdr_width *= 2;
705 } 645 }
706 646
707 /* CSI2 special configuration */
708 if (csi2_subdev(pcdev, icd)) {
709 in_width = ((in_width - 2) * 2);
710 left_offset *= 2;
711 }
712
713 /* Set CAMOR, CAPWR, CFSZR, take care of CDWDR */ 647 /* Set CAMOR, CAPWR, CFSZR, take care of CDWDR */
714 camor = left_offset | (top_offset << 16); 648 camor = left_offset | (top_offset << 16);
715 649
@@ -758,13 +692,6 @@ static void capture_restore(struct sh_mobile_ceu_dev *pcdev, u32 capsr)
758 ceu_write(pcdev, CAPSR, capsr); 692 ceu_write(pcdev, CAPSR, capsr);
759} 693}
760 694
761/* Find the bus subdevice driver, e.g., CSI2 */
762static struct v4l2_subdev *find_bus_subdev(struct sh_mobile_ceu_dev *pcdev,
763 struct soc_camera_device *icd)
764{
765 return csi2_subdev(pcdev, icd) ? : soc_camera_to_subdev(icd);
766}
767
768#define CEU_BUS_FLAGS (V4L2_MBUS_MASTER | \ 695#define CEU_BUS_FLAGS (V4L2_MBUS_MASTER | \
769 V4L2_MBUS_PCLK_SAMPLE_RISING | \ 696 V4L2_MBUS_PCLK_SAMPLE_RISING | \
770 V4L2_MBUS_HSYNC_ACTIVE_HIGH | \ 697 V4L2_MBUS_HSYNC_ACTIVE_HIGH | \
@@ -778,7 +705,7 @@ static int sh_mobile_ceu_set_bus_param(struct soc_camera_device *icd)
778{ 705{
779 struct soc_camera_host *ici = to_soc_camera_host(icd->parent); 706 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
780 struct sh_mobile_ceu_dev *pcdev = ici->priv; 707 struct sh_mobile_ceu_dev *pcdev = ici->priv;
781 struct v4l2_subdev *sd = find_bus_subdev(pcdev, icd); 708 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
782 struct sh_m