diff options
| author | Yuval Adam <_@yuv.al> | 2017-08-30 08:25:59 +0000 |
|---|---|---|
| committer | Yuval Adam <_@yuv.al> | 2017-08-30 08:25:59 +0000 |
| commit | 8e4bff4cab0ddac6060645b0715210484d02ff40 (patch) | |
| tree | 3a5c3024371a04692a3a6d9974d001cdff8ebf84 /drivers/media/sprd_dcam/common/parse_hwinfo.h | |
Diffstat (limited to 'drivers/media/sprd_dcam/common/parse_hwinfo.h')
| -rwxr-xr-x | drivers/media/sprd_dcam/common/parse_hwinfo.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/drivers/media/sprd_dcam/common/parse_hwinfo.h b/drivers/media/sprd_dcam/common/parse_hwinfo.h new file mode 100755 index 00000000..9e1e8f39 --- /dev/null +++ b/drivers/media/sprd_dcam/common/parse_hwinfo.h @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2012 Spreadtrum Communications Inc. + * + * This software is licensed under the terms of the GNU General Public + * License version 2, as published by the Free Software Foundation, and + * may be copied, distributed, and modified under those terms. + * + * 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. + */ +#include <linux/types.h> +#include <linux/of.h> +#include <linux/of_device.h> +#include <linux/of_address.h> +#include <linux/of_irq.h> +#include <linux/sprd_mm.h> + +#ifdef CONFIG_64BIT +#include <soc/sprd/sci_glb_regs.h> +#endif + +extern unsigned long dcam_regbase; +extern unsigned long isp_regbase; +extern unsigned long csi_regbase; + +#ifndef CONFIG_OF +#define DCAM_BASE SPRD_DEV_P2V(dcam_regbase) +#define ISP_BASE SPRD_DEV_P2V(isp_regbase) +#define CSI2_BASE SPRD_DEV_P2V(csi_regbase) + +#else + +#define DCAM_BASE (dcam_regbase) +#define ISP_BASE (isp_regbase) +#define CSI2_BASE (csi_regbase) +#endif + + +enum get_regu_type_e { + REGU_CAMAVDD = 0, + REGU_CAMDVDD, + REGU_CAMIOVDD, + REGU_CAMMOT, + REGU_MAX +}; +enum get_gpio_type_e { + GPIO_CAMDVDD = 0, + GPIO_CAMMAX +}; +#ifdef CONFIG_64BIT +//#define SPRD_ISP_SIZE SZ_32K +//#define SPRD_MMAHB_BASE SPRD_DEV_P2V(REGS_MM_AHB_BASE) +//#define SPRD_MMCKG_BASE SPRD_DEV_P2V(REGS_MM_CLK_BASE) +//#define SPRD_PIN_BASE SPRD_DEV_P2V(0x60a00000) + +//#define SPRD_ADISLAVE_BASE SPRD_DEV_P2V(REGS_ADI_BASE) +#define SPRD_FLASH_OFST 0x890 +#define SPRD_FLASH_CTRL_BIT 0x8000 +#define SPRD_FLASH_LOW_VAL 0x3 +#define SPRD_FLASH_HIGH_VAL 0xF +#define SPRD_FLASH_LOW_CUR 110 +#define SPRD_FLASH_HIGH_CUR 470 +#endif +#define ZTEHZ_FLASH_HIGH_VAL 0xB +void parse_baseaddress(struct device_node *dn); +uint32_t parse_irq(struct device_node *dn); +struct clk * parse_clk(struct device_node *dn, char *clkname); +int get_gpio_id(struct device_node *dn, int *pwn, int *reset, uint32_t sensor_id); +int get_gpio_id_ex(struct device_node *dn, int type, int *id, uint32_t sensor_id); +int get_regulator_name(struct device_node *dn, int *type, uint32_t sensor_id, char **name); |
