linux/drivers/gpio/gpio-gw-pld.c

// SPDX-License-Identifier: GPL-2.0+
//
// Gateworks I2C PLD GPIO expander
//
// Copyright (C) 2019 Linus Walleij <[email protected]>
//
// Based on code and know-how from the OpenWrt driver:
// Copyright (C) 2009 Gateworks Corporation
// Authors: Chris Lang, Imre Kaloz

#include <linux/bits.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/gpio/driver.h>
#include <linux/i2c.h>
#include <linux/module.h>

/**
 * struct gw_pld - State container for Gateworks PLD
 * @chip: GPIO chip instance
 * @client: I2C client
 * @out: shadow register for the output bute
 */
struct gw_pld {};

/*
 * The Gateworks I2C PLD chip only expose one read and one write register.
 * Writing a "one" bit (to match the reset state) lets that pin be used as an
 * input. It is an open-drain model.
 */
static int gw_pld_input8(struct gpio_chip *gc, unsigned offset)
{}

static int gw_pld_get8(struct gpio_chip *gc, unsigned offset)
{}

static int gw_pld_output8(struct gpio_chip *gc, unsigned offset, int value)
{}

static void gw_pld_set8(struct gpio_chip *gc, unsigned offset, int value)
{}

static int gw_pld_probe(struct i2c_client *client)
{}

static const struct i2c_device_id gw_pld_id[] =;
MODULE_DEVICE_TABLE(i2c, gw_pld_id);

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

static struct i2c_driver gw_pld_driver =;
module_i2c_driver();

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