linux/drivers/input/misc/pmic8xxx-pwrkey.c

// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
 */

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/input.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/log2.h>
#include <linux/of.h>

#define PON_CNTL_1
#define PON_CNTL_PULL_UP
#define PON_CNTL_TRIG_DELAY_MASK
#define PON_CNTL_1_PULL_UP_EN
#define PON_CNTL_1_USB_PWR_EN
#define PON_CNTL_1_WD_EN_RESET

#define PM8058_SLEEP_CTRL
#define PM8921_SLEEP_CTRL

#define SLEEP_CTRL_SMPL_EN_RESET

/* Regulator master enable addresses */
#define REG_PM8058_VREG_EN_MSM
#define REG_PM8058_VREG_EN_GRP_5_4

/* Regulator control registers for shutdown/reset */
#define PM8058_S0_CTRL
#define PM8058_S1_CTRL
#define PM8058_S3_CTRL
#define PM8058_L21_CTRL
#define PM8058_L22_CTRL

#define PM8058_REGULATOR_ENABLE_MASK
#define PM8058_REGULATOR_ENABLE
#define PM8058_REGULATOR_DISABLE
#define PM8058_REGULATOR_PULL_DOWN_MASK
#define PM8058_REGULATOR_PULL_DOWN_EN

/* Buck CTRL register */
#define PM8058_SMPS_LEGACY_VREF_SEL
#define PM8058_SMPS_LEGACY_VPROG_MASK
#define PM8058_SMPS_ADVANCED_BAND_MASK
#define PM8058_SMPS_ADVANCED_BAND_SHIFT
#define PM8058_SMPS_ADVANCED_VPROG_MASK

/* Buck TEST2 registers for shutdown/reset */
#define PM8058_S0_TEST2
#define PM8058_S1_TEST2
#define PM8058_S3_TEST2

#define PM8058_REGULATOR_BANK_WRITE
#define PM8058_REGULATOR_BANK_MASK
#define PM8058_REGULATOR_BANK_SHIFT
#define PM8058_REGULATOR_BANK_SEL(n)

/* Buck TEST2 register bank 1 */
#define PM8058_SMPS_LEGACY_VLOW_SEL

/* Buck TEST2 register bank 7 */
#define PM8058_SMPS_ADVANCED_MODE_MASK
#define PM8058_SMPS_ADVANCED_MODE
#define PM8058_SMPS_LEGACY_MODE

/**
 * struct pmic8xxx_pwrkey - pmic8xxx pwrkey information
 * @key_press_irq: key press irq number
 * @regmap: device regmap
 * @shutdown_fn: shutdown configuration function
 */
struct pmic8xxx_pwrkey {};

static irqreturn_t pwrkey_press_irq(int irq, void *_pwr)
{}

static irqreturn_t pwrkey_release_irq(int irq, void *_pwr)
{}

static int pmic8xxx_pwrkey_suspend(struct device *dev)
{}

static int pmic8xxx_pwrkey_resume(struct device *dev)
{}

static DEFINE_SIMPLE_DEV_PM_OPS(pm8xxx_pwr_key_pm_ops,
		pmic8xxx_pwrkey_suspend, pmic8xxx_pwrkey_resume);

static void pmic8xxx_pwrkey_shutdown(struct platform_device *pdev)
{}

/*
 * Set an SMPS regulator to be disabled in its CTRL register, but enabled
 * in the master enable register.  Also set it's pull down enable bit.
 * Take care to make sure that the output voltage doesn't change if switching
 * from advanced mode to legacy mode.
 */
static int pm8058_disable_smps_locally_set_pull_down(struct regmap *regmap,
	u16 ctrl_addr, u16 test2_addr, u16 master_enable_addr,
	u8 master_enable_bit)
{}

static int pm8058_disable_ldo_locally_set_pull_down(struct regmap *regmap,
		u16 ctrl_addr, u16 master_enable_addr, u8 master_enable_bit)
{}

static int pm8058_pwrkey_shutdown(struct pmic8xxx_pwrkey *pwrkey, bool reset)
{}

static int pm8921_pwrkey_shutdown(struct pmic8xxx_pwrkey *pwrkey, bool reset)
{}

static int pmic8xxx_pwrkey_probe(struct platform_device *pdev)
{}

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

static struct platform_driver pmic8xxx_pwrkey_driver =;
module_platform_driver();

MODULE_ALIAS();
MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_AUTHOR();