linux/include/linux/mfd/mc13xxx.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright 2009-2010 Pengutronix
 * Uwe Kleine-Koenig <[email protected]>
 */
#ifndef __LINUX_MFD_MC13XXX_H
#define __LINUX_MFD_MC13XXX_H

#include <linux/interrupt.h>

struct mc13xxx;

void mc13xxx_lock(struct mc13xxx *mc13xxx);
void mc13xxx_unlock(struct mc13xxx *mc13xxx);

int mc13xxx_reg_read(struct mc13xxx *mc13xxx, unsigned int offset, u32 *val);
int mc13xxx_reg_write(struct mc13xxx *mc13xxx, unsigned int offset, u32 val);
int mc13xxx_reg_rmw(struct mc13xxx *mc13xxx, unsigned int offset,
		u32 mask, u32 val);

int mc13xxx_irq_request(struct mc13xxx *mc13xxx, int irq,
		irq_handler_t handler, const char *name, void *dev);
int mc13xxx_irq_free(struct mc13xxx *mc13xxx, int irq, void *dev);

int mc13xxx_irq_status(struct mc13xxx *mc13xxx, int irq,
		int *enabled, int *pending);

int mc13xxx_get_flags(struct mc13xxx *mc13xxx);

int mc13xxx_adc_do_conversion(struct mc13xxx *mc13xxx,
		unsigned int mode, unsigned int channel,
		u8 ato, bool atox, unsigned int *sample);

/* Deprecated calls */
static inline int mc13xxx_irq_ack(struct mc13xxx *mc13xxx, int irq)
{}

static inline int mc13xxx_irq_request_nounmask(struct mc13xxx *mc13xxx, int irq,
					       irq_handler_t handler,
					       const char *name, void *dev)
{}

int mc13xxx_irq_mask(struct mc13xxx *mc13xxx, int irq);
int mc13xxx_irq_unmask(struct mc13xxx *mc13xxx, int irq);

#define MC13783_AUDIO_RX0
#define MC13783_AUDIO_RX1
#define MC13783_AUDIO_TX
#define MC13783_SSI_NETWORK
#define MC13783_AUDIO_CODEC
#define MC13783_AUDIO_DAC

#define MC13XXX_IRQ_ADCDONE
#define MC13XXX_IRQ_ADCBISDONE
#define MC13XXX_IRQ_TS
#define MC13XXX_IRQ_CHGDET
#define MC13XXX_IRQ_CHGREV
#define MC13XXX_IRQ_CHGSHORT
#define MC13XXX_IRQ_CCCV
#define MC13XXX_IRQ_CHGCURR
#define MC13XXX_IRQ_BPON
#define MC13XXX_IRQ_LOBATL
#define MC13XXX_IRQ_LOBATH
#define MC13XXX_IRQ_1HZ
#define MC13XXX_IRQ_TODA
#define MC13XXX_IRQ_SYSRST
#define MC13XXX_IRQ_RTCRST
#define MC13XXX_IRQ_PC
#define MC13XXX_IRQ_WARM
#define MC13XXX_IRQ_MEMHLD
#define MC13XXX_IRQ_THWARNL
#define MC13XXX_IRQ_THWARNH
#define MC13XXX_IRQ_CLK

struct regulator_init_data;

struct mc13xxx_regulator_init_data {};

struct mc13xxx_regulator_platform_data {};

enum {};

struct mc13xxx_led_platform_data {};

#define MAX_LED_CONTROL_REGS

/* MC13783 LED Control 0 */
#define MC13783_LED_C0_ENABLE
#define MC13783_LED_C0_TRIODE_MD
#define MC13783_LED_C0_TRIODE_AD
#define MC13783_LED_C0_TRIODE_KP
#define MC13783_LED_C0_BOOST
#define MC13783_LED_C0_ABMODE(x)
#define MC13783_LED_C0_ABREF(x)
/* MC13783 LED Control 1 */
#define MC13783_LED_C1_TC1HALF
#define MC13783_LED_C1_SLEWLIM
/* MC13783 LED Control 2 */
#define MC13783_LED_C2_CURRENT_MD(x)
#define MC13783_LED_C2_CURRENT_AD(x)
#define MC13783_LED_C2_CURRENT_KP(x)
#define MC13783_LED_C2_PERIOD(x)
#define MC13783_LED_C2_SLEWLIM
/* MC13783 LED Control 3 */
#define MC13783_LED_C3_CURRENT_R1(x)
#define MC13783_LED_C3_CURRENT_G1(x)
#define MC13783_LED_C3_CURRENT_B1(x)
#define MC13783_LED_C3_PERIOD(x)
#define MC13783_LED_C3_TRIODE_TC1
/* MC13783 LED Control 4 */
#define MC13783_LED_C4_CURRENT_R2(x)
#define MC13783_LED_C4_CURRENT_G2(x)
#define MC13783_LED_C4_CURRENT_B2(x)
#define MC13783_LED_C4_PERIOD(x)
#define MC13783_LED_C4_TRIODE_TC2
/* MC13783 LED Control 5 */
#define MC13783_LED_C5_CURRENT_R3(x)
#define MC13783_LED_C5_CURRENT_G3(x)
#define MC13783_LED_C5_CURRENT_B3(x)
#define MC13783_LED_C5_PERIOD(x)
#define MC13783_LED_C5_TRIODE_TC3
/* MC13892 LED Control 0 */
#define MC13892_LED_C0_CURRENT_MD(x)
#define MC13892_LED_C0_CURRENT_AD(x)
/* MC13892 LED Control 1 */
#define MC13892_LED_C1_CURRENT_KP(x)
/* MC13892 LED Control 2 */
#define MC13892_LED_C2_CURRENT_R(x)
#define MC13892_LED_C2_CURRENT_G(x)
/* MC13892 LED Control 3 */
#define MC13892_LED_C3_CURRENT_B(x)
/* MC34708 LED Control 0 */
#define MC34708_LED_C0_CURRENT_R(x)
#define MC34708_LED_C0_CURRENT_G(x)

struct mc13xxx_leds_platform_data {};

#define MC13783_BUTTON_DBNC_0MS
#define MC13783_BUTTON_DBNC_30MS
#define MC13783_BUTTON_DBNC_150MS
#define MC13783_BUTTON_DBNC_750MS
#define MC13783_BUTTON_ENABLE
#define MC13783_BUTTON_POL_INVERT
#define MC13783_BUTTON_RESET_EN

struct mc13xxx_buttons_platform_data {};

#define MC13783_TS_ATO_FIRST
#define MC13783_TS_ATO_EACH

struct mc13xxx_ts_platform_data {};

enum mc13783_ssi_port {};

struct mc13xxx_codec_platform_data {};

#define MC13XXX_USE_TOUCHSCREEN
#define MC13XXX_USE_CODEC
#define MC13XXX_USE_ADC
#define MC13XXX_USE_RTC

struct mc13xxx_platform_data {};

#define MC13XXX_ADC_MODE_TS
#define MC13XXX_ADC_MODE_SINGLE_CHAN
#define MC13XXX_ADC_MODE_MULT_CHAN

#define MC13XXX_ADC0
#define MC13XXX_ADC0_LICELLCON
#define MC13XXX_ADC0_CHRGICON
#define MC13XXX_ADC0_BATICON
#define MC13XXX_ADC0_ADIN7SEL_DIE
#define MC13XXX_ADC0_ADIN7SEL_UID
#define MC13XXX_ADC0_ADREFEN
#define MC13XXX_ADC0_TSMOD0
#define MC13XXX_ADC0_TSMOD1
#define MC13XXX_ADC0_TSMOD2
#define MC13XXX_ADC0_CHRGRAWDIV
#define MC13XXX_ADC0_ADINC1
#define MC13XXX_ADC0_ADINC2

#define MC13XXX_ADC0_TSMOD_MASK

#define MC13XXX_ADC0_CONFIG_MASK

#endif /* ifndef __LINUX_MFD_MC13XXX_H */