mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 21:38:32 +08:00
5a158981aa
This patch corrects the SPDX License Identifier style in header file related to Eckelmann SIOX driver. For C header files Documentation/process/license-rules.rst mandates C-like comments (opposed to C source files where C++ style should be used). Changes made by using a script provided by Joe Perches here: https://lkml.org/lkml/2019/2/7/46. Suggested-by: Joe Perches <joe@perches.com> Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Thorsten Scherer <thorsten.scherer@eckelmann.de> Link: https://lore.kernel.org/r/20200101131418.GA3110@nishad Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
50 lines
1.3 KiB
C
50 lines
1.3 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* Copyright (C) 2015-2017 Pengutronix, Uwe Kleine-König <kernel@pengutronix.de>
|
|
*/
|
|
#include <linux/kernel.h>
|
|
#include <linux/kthread.h>
|
|
#include <linux/siox.h>
|
|
|
|
#define to_siox_master(_dev) container_of((_dev), struct siox_master, dev)
|
|
struct siox_master {
|
|
/* these fields should be initialized by the driver */
|
|
int busno;
|
|
int (*pushpull)(struct siox_master *smaster,
|
|
size_t setbuf_len, const u8 setbuf[],
|
|
size_t getbuf_len, u8 getbuf[]);
|
|
|
|
/* might be initialized by the driver, if 0 it is set to HZ / 40 */
|
|
unsigned long poll_interval; /* in jiffies */
|
|
|
|
/* framework private stuff */
|
|
struct mutex lock;
|
|
bool active;
|
|
struct module *owner;
|
|
struct device dev;
|
|
unsigned int num_devices;
|
|
struct list_head devices;
|
|
|
|
size_t setbuf_len, getbuf_len;
|
|
size_t buf_len;
|
|
u8 *buf;
|
|
u8 status;
|
|
|
|
unsigned long last_poll;
|
|
struct task_struct *poll_thread;
|
|
};
|
|
|
|
static inline void *siox_master_get_devdata(struct siox_master *smaster)
|
|
{
|
|
return dev_get_drvdata(&smaster->dev);
|
|
}
|
|
|
|
struct siox_master *siox_master_alloc(struct device *dev, size_t size);
|
|
static inline void siox_master_put(struct siox_master *smaster)
|
|
{
|
|
put_device(&smaster->dev);
|
|
}
|
|
|
|
int siox_master_register(struct siox_master *smaster);
|
|
void siox_master_unregister(struct siox_master *smaster);
|