linux/include/linux/mfd/motorola-cpcap.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * The register defines are based on earlier cpcap.h in Motorola Linux kernel
 * tree.
 *
 * Copyright (C) 2007-2009 Motorola, Inc.
 *
 * Rewritten for the real register offsets instead of enumeration
 * to make the defines usable with Linux kernel regmap support
 *
 * Copyright (C) 2016 Tony Lindgren <[email protected]>
 */

#include <linux/device.h>
#include <linux/regmap.h>

#define CPCAP_VENDOR_ST
#define CPCAP_VENDOR_TI

#define CPCAP_REVISION_MAJOR(r)
#define CPCAP_REVISION_MINOR(r)

#define CPCAP_REVISION_1_0
#define CPCAP_REVISION_1_1
#define CPCAP_REVISION_2_0
#define CPCAP_REVISION_2_1

/* CPCAP registers */
#define CPCAP_REG_INT1
#define CPCAP_REG_INT2
#define CPCAP_REG_INT3
#define CPCAP_REG_INT4
#define CPCAP_REG_INTM1
#define CPCAP_REG_INTM2
#define CPCAP_REG_INTM3
#define CPCAP_REG_INTM4
#define CPCAP_REG_INTS1
#define CPCAP_REG_INTS2
#define CPCAP_REG_INTS3
#define CPCAP_REG_INTS4
#define CPCAP_REG_ASSIGN1
#define CPCAP_REG_ASSIGN2
#define CPCAP_REG_ASSIGN3
#define CPCAP_REG_ASSIGN4
#define CPCAP_REG_ASSIGN5
#define CPCAP_REG_ASSIGN6
#define CPCAP_REG_VERSC1
#define CPCAP_REG_VERSC2

#define CPCAP_REG_MI1
#define CPCAP_REG_MIM1
#define CPCAP_REG_MI2
#define CPCAP_REG_MIM2
#define CPCAP_REG_UCC1
#define CPCAP_REG_UCC2

#define CPCAP_REG_PC1
#define CPCAP_REG_PC2
#define CPCAP_REG_BPEOL
#define CPCAP_REG_PGC
#define CPCAP_REG_MT1
#define CPCAP_REG_MT2
#define CPCAP_REG_MT3
#define CPCAP_REG_PF

#define CPCAP_REG_SCC
#define CPCAP_REG_SW1
#define CPCAP_REG_SW2
#define CPCAP_REG_UCTM
#define CPCAP_REG_TOD1
#define CPCAP_REG_TOD2
#define CPCAP_REG_TODA1
#define CPCAP_REG_TODA2
#define CPCAP_REG_DAY
#define CPCAP_REG_DAYA
#define CPCAP_REG_VAL1
#define CPCAP_REG_VAL2

#define CPCAP_REG_SDVSPLL
#define CPCAP_REG_SI2CC1
#define CPCAP_REG_Si2CC2
#define CPCAP_REG_S1C1
#define CPCAP_REG_S1C2
#define CPCAP_REG_S2C1
#define CPCAP_REG_S2C2
#define CPCAP_REG_S3C
#define CPCAP_REG_S4C1
#define CPCAP_REG_S4C2
#define CPCAP_REG_S5C
#define CPCAP_REG_S6C
#define CPCAP_REG_VCAMC
#define CPCAP_REG_VCSIC
#define CPCAP_REG_VDACC
#define CPCAP_REG_VDIGC
#define CPCAP_REG_VFUSEC
#define CPCAP_REG_VHVIOC
#define CPCAP_REG_VSDIOC
#define CPCAP_REG_VPLLC
#define CPCAP_REG_VRF1C
#define CPCAP_REG_VRF2C
#define CPCAP_REG_VRFREFC
#define CPCAP_REG_VWLAN1C
#define CPCAP_REG_VWLAN2C
#define CPCAP_REG_VSIMC
#define CPCAP_REG_VVIBC
#define CPCAP_REG_VUSBC
#define CPCAP_REG_VUSBINT1C
#define CPCAP_REG_VUSBINT2C
#define CPCAP_REG_URT
#define CPCAP_REG_URM1
#define CPCAP_REG_URM2

#define CPCAP_REG_VAUDIOC
#define CPCAP_REG_CC
#define CPCAP_REG_CDI
#define CPCAP_REG_SDAC
#define CPCAP_REG_SDACDI
#define CPCAP_REG_TXI
#define CPCAP_REG_TXMP
#define CPCAP_REG_RXOA
#define CPCAP_REG_RXVC
#define CPCAP_REG_RXCOA
#define CPCAP_REG_RXSDOA
#define CPCAP_REG_RXEPOA
#define CPCAP_REG_RXLL
#define CPCAP_REG_A2LA
#define CPCAP_REG_MIPIS1
#define CPCAP_REG_MIPIS2
#define CPCAP_REG_MIPIS3
#define CPCAP_REG_LVAB

#define CPCAP_REG_CCC1
#define CPCAP_REG_CRM
#define CPCAP_REG_CCCC2
#define CPCAP_REG_CCS1
#define CPCAP_REG_CCS2
#define CPCAP_REG_CCA1
#define CPCAP_REG_CCA2
#define CPCAP_REG_CCM
#define CPCAP_REG_CCO
#define CPCAP_REG_CCI

#define CPCAP_REG_ADCC1
#define CPCAP_REG_ADCC2
#define CPCAP_REG_ADCD0
#define CPCAP_REG_ADCD1
#define CPCAP_REG_ADCD2
#define CPCAP_REG_ADCD3
#define CPCAP_REG_ADCD4
#define CPCAP_REG_ADCD5
#define CPCAP_REG_ADCD6
#define CPCAP_REG_ADCD7
#define CPCAP_REG_ADCAL1
#define CPCAP_REG_ADCAL2

#define CPCAP_REG_USBC1
#define CPCAP_REG_USBC2
#define CPCAP_REG_USBC3
#define CPCAP_REG_UVIDL
#define CPCAP_REG_UVIDH
#define CPCAP_REG_UPIDL
#define CPCAP_REG_UPIDH
#define CPCAP_REG_UFC1
#define CPCAP_REG_UFC2
#define CPCAP_REG_UFC3
#define CPCAP_REG_UIC1
#define CPCAP_REG_UIC2
#define CPCAP_REG_UIC3
#define CPCAP_REG_USBOTG1
#define CPCAP_REG_USBOTG2
#define CPCAP_REG_USBOTG3
#define CPCAP_REG_UIER1
#define CPCAP_REG_UIER2
#define CPCAP_REG_UIER3
#define CPCAP_REG_UIEF1
#define CPCAP_REG_UIEF2
#define CPCAP_REG_UIEF3
#define CPCAP_REG_UIS
#define CPCAP_REG_UIL
#define CPCAP_REG_USBD
#define CPCAP_REG_SCR1
#define CPCAP_REG_SCR2
#define CPCAP_REG_SCR3

#define CPCAP_REG_VMC
#define CPCAP_REG_OWDC
#define CPCAP_REG_GPIO0

#define CPCAP_REG_GPIO1

#define CPCAP_REG_GPIO2

#define CPCAP_REG_GPIO3

#define CPCAP_REG_GPIO4

#define CPCAP_REG_GPIO5

#define CPCAP_REG_GPIO6

#define CPCAP_REG_MDLC
#define CPCAP_REG_KLC
#define CPCAP_REG_ADLC
#define CPCAP_REG_REDC
#define CPCAP_REG_GREENC
#define CPCAP_REG_BLUEC
#define CPCAP_REG_CFC
#define CPCAP_REG_ABC
#define CPCAP_REG_BLEDC
#define CPCAP_REG_CLEDC

#define CPCAP_REG_OW1C
#define CPCAP_REG_OW1D
#define CPCAP_REG_OW1I
#define CPCAP_REG_OW1IE

#define CPCAP_REG_OW1

#define CPCAP_REG_OW2C
#define CPCAP_REG_OW2D
#define CPCAP_REG_OW2I
#define CPCAP_REG_OW2IE

#define CPCAP_REG_OW2

#define CPCAP_REG_OW3C
#define CPCAP_REG_OW3D
#define CPCAP_REG_OW3I
#define CPCAP_REG_OW3IE

#define CPCAP_REG_OW3
#define CPCAP_REG_GCAIC
#define CPCAP_REG_GCAIM
#define CPCAP_REG_LGDIR
#define CPCAP_REG_LGPU
#define CPCAP_REG_LGPIN
#define CPCAP_REG_LGMASK
#define CPCAP_REG_LDEB
#define CPCAP_REG_LGDET
#define CPCAP_REG_LMISC
#define CPCAP_REG_LMACE

#define CPCAP_REG_TEST

#define CPCAP_REG_ST_TEST1

#define CPCAP_REG_ST_TEST2

/*
 * Helpers for child devices to check the revision and vendor.
 *
 * REVISIT: No documentation for the bits below, please update
 * to use proper names for defines when available.
 */

static inline int cpcap_get_revision(struct device *dev,
				     struct regmap *regmap,
				     u16 *revision)
{}

static inline int cpcap_get_vendor(struct device *dev,
				   struct regmap *regmap,
				   u16 *vendor)
{}

extern int cpcap_sense_virq(struct regmap *regmap, int virq);