mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-24 01:41:39 +00:00
![Greg Kroah-Hartman](/assets/img/avatar_default.png)
Now that the SPDX tag is in all tty files, that identifies the license in a specific and legally-defined manner. So the extra GPL text wording can be removed as it is no longer needed at all. This is done on a quest to remove the 700+ different ways that files in the kernel describe the GPL license text. And there's unneeded stuff like the address (sometimes incorrect) for the FSF which is never needed. No copyright headers or other non-license-description text was removed. Cc: Jiri Slaby <jslaby@suse.com> Cc: Eric Anholt <eric@anholt.net> Cc: Stefan Wahren <stefan.wahren@i2se.com> Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: Ray Jui <rjui@broadcom.com> Cc: Scott Branden <sbranden@broadcom.com> Cc: bcm-kernel-feedback-list@broadcom.com Cc: "James E.J. Bottomley" <jejb@parisc-linux.org> Cc: Helge Deller <deller@gmx.de> Cc: Joachim Eastwood <manabian@gmail.com> Cc: Matthias Brugger <matthias.bgg@gmail.com> Cc: Masahiro Yamada <yamada.masahiro@socionext.com> Cc: Tobias Klauser <tklauser@distanz.ch> Cc: Russell King <linux@armlinux.org.uk> Cc: Vineet Gupta <vgupta@synopsys.com> Cc: Richard Genoud <richard.genoud@gmail.com> Cc: Alexander Shiyan <shc_work@mail.ru> Cc: Baruch Siach <baruch@tkos.co.il> Cc: Pat Gefre <pfg@sgi.com> Cc: "Guilherme G. Piccoli" <gpiccoli@linux.vnet.ibm.com> Cc: Jason Wessel <jason.wessel@windriver.com> Cc: Vladimir Zapolskiy <vz@mleia.com> Cc: Sylvain Lemieux <slemieux.tyco@gmail.com> Cc: Carlo Caione <carlo@caione.org> Cc: Kevin Hilman <khilman@baylibre.com> Cc: Liviu Dudau <liviu.dudau@arm.com> Cc: Sudeep Holla <sudeep.holla@arm.com> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Cc: Andy Gross <andy.gross@linaro.org> Cc: David Brown <david.brown@linaro.org> Cc: "Andreas Färber" <afaerber@suse.de> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Kevin Cernekee <cernekee@gmail.com> Cc: Laxman Dewangan <ldewangan@nvidia.com> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Jonathan Hunter <jonathanh@nvidia.com> Cc: Barry Song <baohua@kernel.org> Cc: Patrice Chotard <patrice.chotard@st.com> Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com> Cc: Alexandre Torgue <alexandre.torgue@st.com> Cc: Chris Metcalf <cmetcalf@mellanox.com> Cc: Peter Korsgaard <jacmet@sunsite.dk> Cc: Timur Tabi <timur@tabi.org> Cc: Tony Prisk <linux@prisktech.co.nz> Cc: Michal Simek <michal.simek@xilinx.com> Cc: "Sören Brinkmann" <soren.brinkmann@xilinx.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
147 lines
3.3 KiB
C
147 lines
3.3 KiB
C
// SPDX-License-Identifier: GPL-2.0+
|
|
/*
|
|
* Helpers for controlling modem lines via GPIO
|
|
*
|
|
* Copyright (C) 2014 Paratronic S.A.
|
|
*/
|
|
|
|
#ifndef __SERIAL_MCTRL_GPIO__
|
|
#define __SERIAL_MCTRL_GPIO__
|
|
|
|
#include <linux/err.h>
|
|
#include <linux/device.h>
|
|
#include <linux/gpio/consumer.h>
|
|
|
|
struct uart_port;
|
|
|
|
enum mctrl_gpio_idx {
|
|
UART_GPIO_CTS,
|
|
UART_GPIO_DSR,
|
|
UART_GPIO_DCD,
|
|
UART_GPIO_RNG,
|
|
UART_GPIO_RI = UART_GPIO_RNG,
|
|
UART_GPIO_RTS,
|
|
UART_GPIO_DTR,
|
|
UART_GPIO_MAX,
|
|
};
|
|
|
|
/*
|
|
* Opaque descriptor for modem lines controlled by GPIOs
|
|
*/
|
|
struct mctrl_gpios;
|
|
|
|
#ifdef CONFIG_GPIOLIB
|
|
|
|
/*
|
|
* Set state of the modem control output lines via GPIOs.
|
|
*/
|
|
void mctrl_gpio_set(struct mctrl_gpios *gpios, unsigned int mctrl);
|
|
|
|
/*
|
|
* Get state of the modem control input lines from GPIOs.
|
|
* The mctrl flags are updated and returned.
|
|
*/
|
|
unsigned int mctrl_gpio_get(struct mctrl_gpios *gpios, unsigned int *mctrl);
|
|
|
|
/*
|
|
* Get state of the modem control output lines from GPIOs.
|
|
* The mctrl flags are updated and returned.
|
|
*/
|
|
unsigned int
|
|
mctrl_gpio_get_outputs(struct mctrl_gpios *gpios, unsigned int *mctrl);
|
|
|
|
/*
|
|
* Returns the associated struct gpio_desc to the modem line gidx
|
|
*/
|
|
struct gpio_desc *mctrl_gpio_to_gpiod(struct mctrl_gpios *gpios,
|
|
enum mctrl_gpio_idx gidx);
|
|
|
|
/*
|
|
* Request and set direction of modem control line GPIOs and set up irq
|
|
* handling.
|
|
* devm_* functions are used, so there's no need to call mctrl_gpio_free().
|
|
* Returns a pointer to the allocated mctrl structure if ok, -ENOMEM on
|
|
* allocation error.
|
|
*/
|
|
struct mctrl_gpios *mctrl_gpio_init(struct uart_port *port, unsigned int idx);
|
|
|
|
/*
|
|
* Request and set direction of modem control line GPIOs.
|
|
* devm_* functions are used, so there's no need to call mctrl_gpio_free().
|
|
* Returns a pointer to the allocated mctrl structure if ok, -ENOMEM on
|
|
* allocation error.
|
|
*/
|
|
struct mctrl_gpios *mctrl_gpio_init_noauto(struct device *dev,
|
|
unsigned int idx);
|
|
|
|
/*
|
|
* Free the mctrl_gpios structure.
|
|
* Normally, this function will not be called, as the GPIOs will
|
|
* be disposed of by the resource management code.
|
|
*/
|
|
void mctrl_gpio_free(struct device *dev, struct mctrl_gpios *gpios);
|
|
|
|
/*
|
|
* Enable gpio interrupts to report status line changes.
|
|
*/
|
|
void mctrl_gpio_enable_ms(struct mctrl_gpios *gpios);
|
|
|
|
/*
|
|
* Disable gpio interrupts to report status line changes.
|
|
*/
|
|
void mctrl_gpio_disable_ms(struct mctrl_gpios *gpios);
|
|
|
|
#else /* GPIOLIB */
|
|
|
|
static inline
|
|
void mctrl_gpio_set(struct mctrl_gpios *gpios, unsigned int mctrl)
|
|
{
|
|
}
|
|
|
|
static inline
|
|
unsigned int mctrl_gpio_get(struct mctrl_gpios *gpios, unsigned int *mctrl)
|
|
{
|
|
return *mctrl;
|
|
}
|
|
|
|
static inline unsigned int
|
|
mctrl_gpio_get_outputs(struct mctrl_gpios *gpios, unsigned int *mctrl)
|
|
{
|
|
return *mctrl;
|
|
}
|
|
|
|
static inline
|
|
struct gpio_desc *mctrl_gpio_to_gpiod(struct mctrl_gpios *gpios,
|
|
enum mctrl_gpio_idx gidx)
|
|
{
|
|
return ERR_PTR(-ENOSYS);
|
|
}
|
|
|
|
static inline
|
|
struct mctrl_gpios *mctrl_gpio_init(struct uart_port *port, unsigned int idx)
|
|
{
|
|
return ERR_PTR(-ENOSYS);
|
|
}
|
|
|
|
static inline
|
|
struct mctrl_gpios *mctrl_gpio_init_noauto(struct device *dev, unsigned int idx)
|
|
{
|
|
return ERR_PTR(-ENOSYS);
|
|
}
|
|
|
|
static inline
|
|
void mctrl_gpio_free(struct device *dev, struct mctrl_gpios *gpios)
|
|
{
|
|
}
|
|
|
|
static inline void mctrl_gpio_enable_ms(struct mctrl_gpios *gpios)
|
|
{
|
|
}
|
|
|
|
static inline void mctrl_gpio_disable_ms(struct mctrl_gpios *gpios)
|
|
{
|
|
}
|
|
|
|
#endif /* GPIOLIB */
|
|
|
|
#endif
|