gpio.h (1320B)
1/* SPDX-License-Identifier: GPL-2.0-or-later */ 2/* 3 * gpio.h -- GPIO driver for NXP PCF50633 4 * 5 * (C) 2006-2008 by Openmoko, Inc. 6 * All rights reserved. 7 */ 8 9#ifndef __LINUX_MFD_PCF50633_GPIO_H 10#define __LINUX_MFD_PCF50633_GPIO_H 11 12#include <linux/mfd/pcf50633/core.h> 13 14#define PCF50633_GPIO1 1 15#define PCF50633_GPIO2 2 16#define PCF50633_GPIO3 3 17#define PCF50633_GPO 4 18 19#define PCF50633_REG_GPIO1CFG 0x14 20#define PCF50633_REG_GPIO2CFG 0x15 21#define PCF50633_REG_GPIO3CFG 0x16 22#define PCF50633_REG_GPOCFG 0x17 23 24#define PCF50633_GPOCFG_GPOSEL_MASK 0x07 25 26enum pcf50633_reg_gpocfg { 27 PCF50633_GPOCFG_GPOSEL_0 = 0x00, 28 PCF50633_GPOCFG_GPOSEL_LED_NFET = 0x01, 29 PCF50633_GPOCFG_GPOSEL_SYSxOK = 0x02, 30 PCF50633_GPOCFG_GPOSEL_CLK32K = 0x03, 31 PCF50633_GPOCFG_GPOSEL_ADAPUSB = 0x04, 32 PCF50633_GPOCFG_GPOSEL_USBxOK = 0x05, 33 PCF50633_GPOCFG_GPOSEL_ACTPH4 = 0x06, 34 PCF50633_GPOCFG_GPOSEL_1 = 0x07, 35 PCF50633_GPOCFG_GPOSEL_INVERSE = 0x08, 36}; 37 38int pcf50633_gpio_set(struct pcf50633 *pcf, int gpio, u8 val); 39u8 pcf50633_gpio_get(struct pcf50633 *pcf, int gpio); 40 41int pcf50633_gpio_invert_set(struct pcf50633 *, int gpio, int invert); 42int pcf50633_gpio_invert_get(struct pcf50633 *pcf, int gpio); 43 44int pcf50633_gpio_power_supply_set(struct pcf50633 *, 45 int gpio, int regulator, int on); 46#endif /* __LINUX_MFD_PCF50633_GPIO_H */ 47 48