linux/drivers/gpio/gpio-cs5535.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * AMD CS5535/CS5536 GPIO driver
 * Copyright (C) 2006  Advanced Micro Devices, Inc.
 * Copyright (C) 2007-2009  Andres Salomon <[email protected]>
 */

#include <linux/kernel.h>
#include <linux/spinlock.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/gpio/driver.h>
#include <linux/io.h>
#include <linux/cs5535.h>
#include <asm/msr.h>

#define DRV_NAME

/*
 * Some GPIO pins
 *  31-29,23 : reserved (always mask out)
 *  28       : Power Button
 *  26       : PME#
 *  22-16    : LPC
 *  14,15    : SMBus
 *  9,8      : UART1
 *  7        : PCI INTB
 *  3,4      : UART2/DDC
 *  2        : IDE_IRQ0
 *  1        : AC_BEEP
 *  0        : PCI INTA
 *
 * If a mask was not specified, allow all except
 * reserved and Power Button
 */
#define GPIO_DEFAULT_MASK

static ulong mask =;
module_param_named(mask, mask, ulong, 0444);
MODULE_PARM_DESC();

/*
 * FIXME: convert this singleton driver to use the state container
 * design pattern, see Documentation/driver-api/driver-model/design-patterns.rst
 */
static struct cs5535_gpio_chip {} cs5535_gpio_chip;

/*
 * The CS5535/CS5536 GPIOs support a number of extra features not defined
 * by the gpio_chip API, so these are exported.  For a full list of the
 * registers, see include/linux/cs5535.h.
 */

static void errata_outl(struct cs5535_gpio_chip *chip, u32 val,
		unsigned int reg)
{}

static void __cs5535_gpio_set(struct cs5535_gpio_chip *chip, unsigned offset,
		unsigned int reg)
{}

void cs5535_gpio_set(unsigned offset, unsigned int reg)
{}
EXPORT_SYMBOL_GPL();

static void __cs5535_gpio_clear(struct cs5535_gpio_chip *chip, unsigned offset,
		unsigned int reg)
{}

void cs5535_gpio_clear(unsigned offset, unsigned int reg)
{}
EXPORT_SYMBOL_GPL();

int cs5535_gpio_isset(unsigned offset, unsigned int reg)
{}
EXPORT_SYMBOL_GPL();

int cs5535_gpio_set_irq(unsigned group, unsigned irq)
{}
EXPORT_SYMBOL_GPL();

void cs5535_gpio_setup_event(unsigned offset, int pair, int pme)
{}
EXPORT_SYMBOL_GPL();

/*
 * Generic gpio_chip API support.
 */

static int chip_gpio_request(struct gpio_chip *c, unsigned offset)
{}

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

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

static int chip_direction_input(struct gpio_chip *c, unsigned offset)
{}

static int chip_direction_output(struct gpio_chip *c, unsigned offset, int val)
{}

static const char * const cs5535_gpio_names[] =;

static struct cs5535_gpio_chip cs5535_gpio_chip =;

static int cs5535_gpio_probe(struct platform_device *pdev)
{}

static struct platform_driver cs5535_gpio_driver =;

module_platform_driver();

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