Source
static void max732x_gpio_set_mask(struct gpio_chip *gc, unsigned off, int mask,
/*
* MAX732x I2C Port Expander with 8/16 I/O
*
* Copyright (C) 2007 Marvell International Ltd.
* Copyright (C) 2008 Jack Ren <jack.ren@marvell.com>
* Copyright (C) 2008 Eric Miao <eric.miao@marvell.com>
* Copyright (C) 2015 Linus Walleij <linus.walleij@linaro.org>
*
* Derived from drivers/gpio/pca953x.c
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*/
/*
* Each port of MAX732x (including MAX7319) falls into one of the
* following three types:
*
* - Push Pull Output
* - Input
* - Open Drain I/O
*
* designated by 'O', 'I' and 'P' individually according to MAXIM's
* datasheets. 'I' and 'P' ports are interrupt capables, some with
* a dedicated interrupt mask.
*
* There are two groups of I/O ports, each group usually includes
* up to 8 I/O ports, and is accessed by a specific I2C address:
*
* - Group A : by I2C address 0b'110xxxx
* - Group B : by I2C address 0b'101xxxx
*
* where 'xxxx' is decided by the connections of pin AD2/AD0. The
* address used also affects the initial state of output signals.
*
* Within each group of ports, there are five known combinations of
* I/O ports: 4I4O, 4P4O, 8I, 8P, 8O, see the definitions below for
* the detailed organization of these ports. Only Goup A is interrupt
* capable.
*
* GPIO numbers start from 'gpio_base + 0' to 'gpio_base + 8/16',
* and GPIOs from GROUP_A are numbered before those from GROUP_B
* (if there are two groups).
*
* NOTE: MAX7328/MAX7329 are drop-in replacements for PCF8574/a, so
* they are not supported by this driver.
*/
/* '/' No Port */
/* 'O' Push-Pull, Output Only */
/* 'I' Input Only */