mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
Add ov5693 camera sensor driver code, mode tables and makefile changes. Bug 3583587 Change-Id: Ib692c0a68cb893583c41da0d58bda0be80dd74e3 Signed-off-by: Ankur Pawar <ankurp@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2864554 Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-by: Semi Malinen <smalinen@nvidia.com> Reviewed-by: Bitan Biswas <bbiswas@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
92 lines
2.9 KiB
C
92 lines
2.9 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* Copyright (c) 2012-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
*
|
|
*/
|
|
|
|
#ifndef __NVC_H__
|
|
#define __NVC_H__
|
|
|
|
#include <linux/regulator/consumer.h>
|
|
#include <uapi/media/nvc.h>
|
|
|
|
#define MAKE_CONSTUSER_PTR(p) ((const void __user *)((unsigned long)(p)))
|
|
#define MAKE_USER_PTR(p) ((void __user *)((unsigned long)(p)))
|
|
|
|
/* The NVC_CFG_ defines are for the .cfg entry in the
|
|
* platform data structure.
|
|
*/
|
|
/* Device not registered if not found */
|
|
#define NVC_CFG_NODEV (1 << 0)
|
|
/* Don't return errors */
|
|
#define NVC_CFG_NOERR (1 << 1)
|
|
/* Always go to _PWR_STDBY instead of _PWR_OFF */
|
|
#define NVC_CFG_OFF2STDBY (1 << 2)
|
|
/* Init device at sys boot */
|
|
#define NVC_CFG_BOOT_INIT (1 << 3)
|
|
/* Sync mode uses an I2C MUX to send at same time */
|
|
#define NVC_CFG_SYNC_I2C_MUX (1 << 4)
|
|
|
|
struct nvc_regulator_init {
|
|
unsigned int vreg_num;
|
|
const char *vreg_name;
|
|
};
|
|
|
|
struct nvc_regulator {
|
|
bool vreg_flag;
|
|
struct regulator *vreg;
|
|
const char *vreg_name;
|
|
};
|
|
|
|
/* The GPIO mechanism uses the _gpio_type in the device's header file as a key
|
|
* to define all the possible GPIO's the device will need. The key is used to
|
|
* combine the GPIO's defined in the platform board file using the
|
|
* nvc_gpio_pdata structure with the nvc_gpio structure in the nvc kernel
|
|
* driver.
|
|
*/
|
|
struct nvc_gpio_pdata {
|
|
/* use a _gpio_type enum from the device's header file */
|
|
unsigned int gpio_type;
|
|
/* the GPIO system number */
|
|
unsigned int gpio;
|
|
/* init_en is typically set to true for all GPIO's used by the driver.
|
|
* However, some GPIO's are used by multiple drivers (CSI MUX, reset,
|
|
* etc.). In this case, this is set true for only one of the drivers
|
|
* that uses the GPIO and false for the others. If the platform board
|
|
* file initializes the GPIO, then this is false for all of the drivers
|
|
* using the GPIO.
|
|
*/
|
|
bool init_en;
|
|
/* this defines the assert level for the general purpose GPIO's
|
|
* (_GPIO_TYPE_GPx, etc.). The _GPIO_TYPE_GPx can be used for a GPIO
|
|
* that the driver doesn't know about but is needed in order for the
|
|
* device to work (CSI select, regulator, etc.). The driver will
|
|
* blindly assert the GPIO when the device is operational and deassert
|
|
* when the device is turned off.
|
|
*/
|
|
bool active_high;
|
|
};
|
|
|
|
struct nvc_gpio_init {
|
|
/* key to match in nvc_gpio_pdata */
|
|
unsigned int gpio_type;
|
|
/* same as in gpio.h */
|
|
unsigned long flags;
|
|
/* same as in gpio.h */
|
|
const char *label;
|
|
/* used instead of nvc_gpio_pdata.active_high if use_flags true */
|
|
bool active_high;
|
|
/* false if nvc_gpio_pdata.active_high used else flags is used */
|
|
bool use_flags;
|
|
};
|
|
|
|
struct nvc_gpio {
|
|
unsigned int gpio; /* system GPIO number */
|
|
bool own; /* gets set if driver initializes */
|
|
bool active_high; /* used for GP GPIOs */
|
|
bool valid; /* set if struct data is valid */
|
|
bool flag; /* scratch flag for driver implementation */
|
|
};
|
|
|
|
#endif /* __NVC_H__ */
|