media: smiapp: add CCP2 support
authorPavel Machek <pavel@ucw.cz>
Tue, 14 Feb 2017 22:39:09 +0000 (17:39 -0500)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Wed, 19 Jul 2017 19:45:00 +0000 (15:45 -0400)
Add support for CCP2 connected SMIA sensors as found
on the Nokia N900.

Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/i2c/smiapp/smiapp-core.c

index e0b0c032c4acec4741c5ec20ab65f97586bde0b2..aff55e1dffe73b348f8aa77c74863f33968b1a75 100644 (file)
@@ -2809,13 +2809,19 @@ static struct smiapp_hwconfig *smiapp_get_hwconfig(struct device *dev)
        switch (bus_cfg->bus_type) {
        case V4L2_MBUS_CSI2:
                hwcfg->csi_signalling_mode = SMIAPP_CSI_SIGNALLING_MODE_CSI2;
+               hwcfg->lanes = bus_cfg->bus.mipi_csi2.num_data_lanes;
+               break;
+       case V4L2_MBUS_CCP2:
+               hwcfg->csi_signalling_mode = (bus_cfg->bus.mipi_csi1.strobe) ?
+               SMIAPP_CSI_SIGNALLING_MODE_CCP2_DATA_STROBE :
+               SMIAPP_CSI_SIGNALLING_MODE_CCP2_DATA_CLOCK;
+               hwcfg->lanes = 1;
                break;
-               /* FIXME: add CCP2 support. */
        default:
+               dev_err(dev, "unsupported bus %u\n", bus_cfg->bus_type);
                goto out_err;
        }
 
-       hwcfg->lanes = bus_cfg->bus.mipi_csi2.num_data_lanes;
        dev_dbg(dev, "lanes %u\n", hwcfg->lanes);
 
        /* NVM size is not mandatory */
@@ -2828,8 +2834,8 @@ static struct smiapp_hwconfig *smiapp_get_hwconfig(struct device *dev)
                goto out_err;
        }
 
-       dev_dbg(dev, "nvm %d, clk %d, csi %d\n", hwcfg->nvm_size,
-               hwcfg->ext_clk, hwcfg->csi_signalling_mode);
+       dev_dbg(dev, "nvm %d, clk %d, mode %d\n",
+               hwcfg->nvm_size, hwcfg->ext_clk, hwcfg->csi_signalling_mode);
 
        if (!bus_cfg->nr_of_link_frequencies) {
                dev_warn(dev, "no link frequencies defined\n");