linux/drivers/gpio/gpio-pmic-eic-sprd.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (C) 2018 Spreadtrum Communications Inc.
 * Copyright (C) 2018 Linaro Ltd.
 */

#include <linux/gpio/driver.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>

/* EIC registers definition */
#define SPRD_PMIC_EIC_DATA
#define SPRD_PMIC_EIC_DMSK
#define SPRD_PMIC_EIC_IEV
#define SPRD_PMIC_EIC_IE
#define SPRD_PMIC_EIC_RIS
#define SPRD_PMIC_EIC_MIS
#define SPRD_PMIC_EIC_IC
#define SPRD_PMIC_EIC_TRIG
#define SPRD_PMIC_EIC_CTRL0

/*
 * The PMIC EIC controller only has one bank, and each bank now can contain
 * 16 EICs.
 */
#define SPRD_PMIC_EIC_PER_BANK_NR
#define SPRD_PMIC_EIC_NR
#define SPRD_PMIC_EIC_DATA_MASK
#define SPRD_PMIC_EIC_BIT(x)
#define SPRD_PMIC_EIC_DBNC_MASK

/*
 * These registers are modified under the irq bus lock and cached to avoid
 * unnecessary writes in bus_sync_unlock.
 */
enum {};

/**
 * struct sprd_pmic_eic - PMIC EIC controller
 * @chip: the gpio_chip structure.
 * @map:  the regmap from the parent device.
 * @offset: the EIC controller's offset address of the PMIC.
 * @reg: the array to cache the EIC registers.
 * @buslock: for bus lock/sync and unlock.
 * @irq: the interrupt number of the PMIC EIC conteroller.
 */
struct sprd_pmic_eic {};

static void sprd_pmic_eic_update(struct gpio_chip *chip, unsigned int offset,
				 u16 reg, unsigned int val)
{}

static int sprd_pmic_eic_read(struct gpio_chip *chip, unsigned int offset,
			      u16 reg)
{}

static int sprd_pmic_eic_request(struct gpio_chip *chip, unsigned int offset)
{}

static void sprd_pmic_eic_free(struct gpio_chip *chip, unsigned int offset)
{}

static int sprd_pmic_eic_get(struct gpio_chip *chip, unsigned int offset)
{}

static int sprd_pmic_eic_direction_input(struct gpio_chip *chip,
					 unsigned int offset)
{}

static void sprd_pmic_eic_set(struct gpio_chip *chip, unsigned int offset,
			      int value)
{}

static int sprd_pmic_eic_set_debounce(struct gpio_chip *chip,
				      unsigned int offset,
				      unsigned int debounce)
{}

static int sprd_pmic_eic_set_config(struct gpio_chip *chip, unsigned int offset,
				    unsigned long config)
{}

static void sprd_pmic_eic_irq_mask(struct irq_data *data)
{}

static void sprd_pmic_eic_irq_unmask(struct irq_data *data)
{}

static int sprd_pmic_eic_irq_set_type(struct irq_data *data,
				      unsigned int flow_type)
{}

static void sprd_pmic_eic_bus_lock(struct irq_data *data)
{}

static void sprd_pmic_eic_bus_sync_unlock(struct irq_data *data)
{}

static void sprd_pmic_eic_toggle_trigger(struct gpio_chip *chip,
					 unsigned int irq, unsigned int offset)
{}

static irqreturn_t sprd_pmic_eic_irq_handler(int irq, void *data)
{}

static const struct irq_chip pmic_eic_irq_chip =;

static int sprd_pmic_eic_probe(struct platform_device *pdev)
{}

static const struct of_device_id sprd_pmic_eic_of_match[] =;
MODULE_DEVICE_TABLE(of, sprd_pmic_eic_of_match);

static struct platform_driver sprd_pmic_eic_driver =;

module_platform_driver();

MODULE_DESCRIPTION();
MODULE_LICENSE();