Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 91825400 authored by Manjunath Hadli's avatar Manjunath Hadli Committed by Mauro Carvalho Chehab
Browse files

[media] davinci: vpfe: add v4l2 capture driver with media interface



Add the vpfe capture driver which implements media controller
interface. The driver supports the DM365 sub ip units for capture
namely - ISIF, IPIPE, IPIPEIF, Resizer. This file represents the main
driver which does isr registration, v4l2 device registration,
media registration and platform driver registrations.
It calls the appropriate subdevs from here to create subdevices
and media entities.

Signed-off-by: default avatarManjunath Hadli <manjunath.hadli@ti.com>
Signed-off-by: default avatarLad, Prabhakar <prabhakar.lad@ti.com>
Acked-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: default avatarSakari Ailus <sakari.ailus@iki.fi>
Acked-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent d31c1002
Loading
Loading
Loading
Loading
+1290 −0

File added.

Preview size limit exceeded, changes collapsed.

+86 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2012 Texas Instruments Inc
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation version 2.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 *
 * Contributors:
 *      Manjunath Hadli <manjunath.hadli@ti.com>
 *      Prabhakar Lad <prabhakar.lad@ti.com>
 */

#ifndef _VPFE_H
#define _VPFE_H

#ifdef __KERNEL__
#include <linux/v4l2-subdev.h>
#include <linux/clk.h>
#include <linux/i2c.h>

#include <media/davinci/vpfe_types.h>

#define CAPTURE_DRV_NAME	"vpfe-capture"

struct vpfe_route {
	__u32 input;
	__u32 output;
};

enum vpfe_subdev_id {
	VPFE_SUBDEV_TVP5146 = 1,
	VPFE_SUBDEV_MT9T031 = 2,
	VPFE_SUBDEV_TVP7002 = 3,
	VPFE_SUBDEV_MT9P031 = 4,
};

struct vpfe_ext_subdev_info {
	/* v4l2 subdev */
	struct v4l2_subdev *subdev;
	/* Sub device module name */
	char module_name[32];
	/* Sub device group id */
	int grp_id;
	/* Number of inputs supported */
	int num_inputs;
	/* inputs available at the sub device */
	struct v4l2_input *inputs;
	/* Sub dev routing information for each input */
	struct vpfe_route *routes;
	/* ccdc bus/interface configuration */
	struct vpfe_hw_if_param ccdc_if_params;
	/* i2c subdevice board info */
	struct i2c_board_info board_info;
	/* Is this a camera sub device ? */
	unsigned is_camera:1;
	/* check if sub dev supports routing */
	unsigned can_route:1;
	/* registered ? */
	unsigned registered:1;
};

struct vpfe_config {
	/* Number of sub devices connected to vpfe */
	int num_subdevs;
	/* information about each subdev */
	struct vpfe_ext_subdev_info *sub_devs;
	/* evm card info */
	char *card_name;
	/* setup function for the input path */
	int (*setup_input)(enum vpfe_subdev_id id);
	/* number of clocks */
	int num_clocks;
	/* clocks used for vpfe capture */
	char *clocks[];
};
#endif
#endif
+740 −0

File added.

Preview size limit exceeded, changes collapsed.

+97 −0

File added.

Preview size limit exceeded, changes collapsed.