linux/drivers/media/platform/ti/omap3isp/isph3a.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * isph3a.h
 *
 * TI OMAP3 ISP - H3A AF module
 *
 * Copyright (C) 2010 Nokia Corporation
 * Copyright (C) 2009 Texas Instruments, Inc.
 *
 * Contacts: David Cohen <[email protected]>
 *	     Laurent Pinchart <[email protected]>
 *	     Sakari Ailus <[email protected]>
 */

#ifndef OMAP3_ISP_H3A_H
#define OMAP3_ISP_H3A_H

#include <linux/omap3isp.h>

/*
 * ----------
 * -H3A AEWB-
 * ----------
 */

#define AEWB_PACKET_SIZE
#define AEWB_SATURATION_LIMIT

/* Flags for changed registers */
#define PCR_CHNG
#define AEWWIN1_CHNG
#define AEWINSTART_CHNG
#define AEWINBLK_CHNG
#define AEWSUBWIN_CHNG
#define PRV_WBDGAIN_CHNG
#define PRV_WBGAIN_CHNG

/* ISPH3A REGISTERS bits */
#define ISPH3A_PCR_AF_EN
#define ISPH3A_PCR_AF_ALAW_EN
#define ISPH3A_PCR_AF_MED_EN
#define ISPH3A_PCR_AF_BUSY
#define ISPH3A_PCR_AEW_EN
#define ISPH3A_PCR_AEW_ALAW_EN
#define ISPH3A_PCR_AEW_BUSY
#define ISPH3A_PCR_AEW_MASK

/*
 * --------
 * -H3A AF-
 * --------
 */

/* Peripheral Revision */
#define AFPID

#define AFCOEF_OFFSET

/* PCR fields */
#define AF_BUSYAF
#define AF_FVMODE
#define AF_RGBPOS
#define AF_MED_TH
#define AF_MED_EN
#define AF_ALAW_EN
#define AF_EN
#define AF_PCR_MASK

/* AFPAX1 fields */
#define AF_PAXW
#define AF_PAXH

/* AFPAX2 fields */
#define AF_AFINCV
#define AF_PAXVC
#define AF_PAXHC

/* AFPAXSTART fields */
#define AF_PAXSH
#define AF_PAXSV

/* COEFFICIENT MASK */
#define AF_COEF_MASK0
#define AF_COEF_MASK1

/* BIT SHIFTS */
#define AF_RGBPOS_SHIFT
#define AF_MED_TH_SHIFT
#define AF_PAXW_SHIFT
#define AF_LINE_INCR_SHIFT
#define AF_VT_COUNT_SHIFT
#define AF_HZ_START_SHIFT
#define AF_COEF_SHIFT

/* Init and cleanup functions */
int omap3isp_h3a_aewb_init(struct isp_device *isp);
int omap3isp_h3a_af_init(struct isp_device *isp);

void omap3isp_h3a_aewb_cleanup(struct isp_device *isp);
void omap3isp_h3a_af_cleanup(struct isp_device *isp);

#endif /* OMAP3_ISP_H3A_H */