forked from luck/tmp_suning_uos_patched
2ec98f5678
Core: - When a gpio_chip request GPIOs from itself, it can now fully control the line characteristics, both machine and consumer flags. This makes a lot of sense, but took some time before I figured out that this is how it has to work. - Several smallish documentation fixes. New drivers: - The PCA953x driver now supports the TI TCA9539. - The DaVinci driver now supports the K3 AM654 SoCs. Driver improvements: - Major overhaul and hardening of the OMAP driver by Russell King. - Starting to move some drivers to the new API passing irq_chip along with the gpio_chip when adding the gpio_chip instead of adding it separately. Unrelated: - Delete the FMC subsystem. -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEElDRnuGcz/wPCXQWMQRCzN7AZXXMFAl0i7gEACgkQQRCzN7AZ XXOeUA/+JKyI2zebTWBcgtxhn6VQCufMCtFmQl2JkEcy4pT7aBJcGWqFQCBW2Szf VTtqc8nNa90SZoOzsNbkeQgRjNKGZruMbh0ARUPcW4v3ZJHtUNUEDLTo8c3iyTgS 9k/FTeaTLt4WSZujeAO0O7G4KNnOOlTKLh58dr0PmXUR+0v+fbMhcJqJ9ABueV+V qENdpkTuG1ZcvzgLhBBEXdt3Plw9ICLWmPXtwY+784ewucVPbyQX7jV4+bBZ25fL DerCuMIgL5vRWWdiFO6/Jp603rHzZpTnjLJJocXUFiD6zA5rvU2jTWxsnUttjisg 8cTLMyQspsDvBxhEhCJVTuIKotbKH900TSaz+vx20W72/A1euy4y6uVi8FGZo4Ww KDkzB7anwHyEFKGnlYgHzDrfctgZrhQoyFz808DQRYg1JseZB5oGVDvScrPBD43j nbNDd8gwG4yp3tFnDx9xjIwQy3Ax4d510rAZyUN2801IlbA1bueq4t6Z2cCucWzX XA1gCKlXe4BUeitRAoZtqZNZG1ymEysW4jXy1V8xrwtAf8+QSN+xO98akz3VpnQL ae9q+HtF76fDBY1xFSXT37Ma3+4OR2vMF9QWuo4TCb9j1cL7llf8ZxtUq9LEHbDu erKLSSnwSFmqJNGSEA5SulGOCR/tRPkClngE9x0XEM6gOD+bs6E= =8zSV -----END PGP SIGNATURE----- Merge tag 'gpio-v5.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio Pull GPIO updates from Linus Walleij: "This is the big slew of GPIO changes for the v5.3 kernel cycle. This is mostly incremental work this time. Three important things: - The FMC subsystem is deleted through my tree. This happens through GPIO as its demise was discussed in relation to a patch decoupling its GPIO implementation from the standard way of handling GPIO. As it turns out, that is not the only subsystem it reimplements and the authors think it is better do scratch it and start over using the proper kernel subsystems than try to polish the rust shiny. See the commit (ACKed by the maintainers) for details. - Arnd made a small devres patch that was ACKed by Greg and goes into the device core. - SPDX header change colissions may happen, because at times I've seen that quite a lot changed during the -rc:s in regards to SPDX. (It is good stuff, tglx has me convinced, and it is worth the occasional pain.) Apart from this is is nothing controversial or problematic. Summary: Core: - When a gpio_chip request GPIOs from itself, it can now fully control the line characteristics, both machine and consumer flags. This makes a lot of sense, but took some time before I figured out that this is how it has to work. - Several smallish documentation fixes. New drivers: - The PCA953x driver now supports the TI TCA9539. - The DaVinci driver now supports the K3 AM654 SoCs. Driver improvements: - Major overhaul and hardening of the OMAP driver by Russell King. - Starting to move some drivers to the new API passing irq_chip along with the gpio_chip when adding the gpio_chip instead of adding it separately. Unrelated: - Delete the FMC subsystem" * tag 'gpio-v5.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (87 commits) Revert "gpio: tegra: Clean-up debugfs initialisation" gpiolib: Use spinlock_t instead of struct spinlock gpio: stp-xway: allow compile-testing gpio: stp-xway: get rid of the #include <lantiq_soc.h> dependency gpio: stp-xway: improve module clock error handling gpio: stp-xway: simplify error handling in xway_stp_probe() gpiolib: Clarify use of non-sleeping functions gpiolib: Fix references to gpiod_[gs]et_*value_cansleep() variants gpiolib: Document new gpio_chip.init_valid_mask field Documentation: gpio: Fix reference to gpiod_get_array() gpio: pl061: drop duplicate printing of device name gpio: altera: Pass irqchip when adding gpiochip gpio: siox: Use devm_ managed gpiochip gpio: siox: Add struct device *dev helper variable gpio: siox: Pass irqchip when adding gpiochip drivers: gpio: amd-fch: make resource struct const devres: allow const resource arguments gpio: ath79: Pass irqchip when adding gpiochip gpio: tegra: Clean-up debugfs initialisation gpio: siox: Switch to IRQ_TYPE_NONE ...
85 lines
2.3 KiB
C
85 lines
2.3 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright (C) 2015 Pengutronix, Uwe Kleine-König <kernel@pengutronix.de>
|
|
*/
|
|
|
|
#include <linux/device.h>
|
|
|
|
#define to_siox_device(_dev) container_of((_dev), struct siox_device, dev)
|
|
struct siox_device {
|
|
struct list_head node; /* node in smaster->devices */
|
|
struct siox_master *smaster;
|
|
struct device dev;
|
|
|
|
const char *type;
|
|
size_t inbytes;
|
|
size_t outbytes;
|
|
u8 statustype;
|
|
|
|
u8 status_read_clean;
|
|
u8 status_written;
|
|
u8 status_written_lastcycle;
|
|
bool connected;
|
|
|
|
/* statistics */
|
|
unsigned int watchdog_errors;
|
|
unsigned int status_errors;
|
|
|
|
struct kernfs_node *status_errors_kn;
|
|
struct kernfs_node *watchdog_kn;
|
|
struct kernfs_node *watchdog_errors_kn;
|
|
struct kernfs_node *connected_kn;
|
|
};
|
|
|
|
bool siox_device_synced(struct siox_device *sdevice);
|
|
bool siox_device_connected(struct siox_device *sdevice);
|
|
|
|
struct siox_driver {
|
|
int (*probe)(struct siox_device *sdevice);
|
|
int (*remove)(struct siox_device *sdevice);
|
|
void (*shutdown)(struct siox_device *sdevice);
|
|
|
|
/*
|
|
* buf is big enough to hold sdev->inbytes - 1 bytes, the status byte
|
|
* is in the scope of the framework.
|
|
*/
|
|
int (*set_data)(struct siox_device *sdevice, u8 status, u8 buf[]);
|
|
/*
|
|
* buf is big enough to hold sdev->outbytes - 1 bytes, the status byte
|
|
* is in the scope of the framework
|
|
*/
|
|
int (*get_data)(struct siox_device *sdevice, const u8 buf[]);
|
|
|
|
struct device_driver driver;
|
|
};
|
|
|
|
static inline struct siox_driver *to_siox_driver(struct device_driver *driver)
|
|
{
|
|
if (driver)
|
|
return container_of(driver, struct siox_driver, driver);
|
|
else
|
|
return NULL;
|
|
}
|
|
|
|
int __siox_driver_register(struct siox_driver *sdriver, struct module *owner);
|
|
|
|
static inline int siox_driver_register(struct siox_driver *sdriver)
|
|
{
|
|
return __siox_driver_register(sdriver, THIS_MODULE);
|
|
}
|
|
|
|
static inline void siox_driver_unregister(struct siox_driver *sdriver)
|
|
{
|
|
return driver_unregister(&sdriver->driver);
|
|
}
|
|
|
|
/*
|
|
* module_siox_driver() - Helper macro for drivers that don't do
|
|
* anything special in module init/exit. This eliminates a lot of
|
|
* boilerplate. Each module may only use this macro once, and
|
|
* calling it replaces module_init() and module_exit()
|
|
*/
|
|
#define module_siox_driver(__siox_driver) \
|
|
module_driver(__siox_driver, siox_driver_register, \
|
|
siox_driver_unregister)
|