mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-25 15:00:53 +07:00
313162d0b8
The <linux/device.h> header includes a lot of stuff, and it in turn gets a lot of use just for the basic "struct device" which appears so often. Clean up the users as follows: 1) For those headers only needing "struct device" as a pointer in fcn args, replace the include with exactly that. 2) For headers not really using anything from device.h, simply delete the include altogether. 3) For headers relying on getting device.h implicitly before being included themselves, now explicitly include device.h 4) For files in which doing #1 or #2 uncovers an implicit dependency on some other header, fix by explicitly adding the required header(s). Any C files that were implicitly relying on device.h to be present have already been dealt with in advance. Total removals from #1 and #2: 51. Total additions coming from #3: 9. Total other implicit dependencies from #4: 7. As of 3.3-rc1, there were 110, so a net removal of 42 gives about a 38% reduction in device.h presence in include/* Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
67 lines
1.6 KiB
C
67 lines
1.6 KiB
C
/*
|
|
* Silicon Labs C2 port Linux support
|
|
*
|
|
* Copyright (c) 2007 Rodolfo Giometti <giometti@linux.it>
|
|
* Copyright (c) 2007 Eurotech S.p.A. <info@eurotech.it>
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
* under the terms of the GNU General Public License version 2 as published by
|
|
* the Free Software Foundation
|
|
*/
|
|
|
|
#include <linux/kmemcheck.h>
|
|
|
|
#define C2PORT_NAME_LEN 32
|
|
|
|
struct device;
|
|
|
|
/*
|
|
* C2 port basic structs
|
|
*/
|
|
|
|
/* Main struct */
|
|
struct c2port_ops;
|
|
struct c2port_device {
|
|
kmemcheck_bitfield_begin(flags);
|
|
unsigned int access:1;
|
|
unsigned int flash_access:1;
|
|
kmemcheck_bitfield_end(flags);
|
|
|
|
int id;
|
|
char name[C2PORT_NAME_LEN];
|
|
struct c2port_ops *ops;
|
|
struct mutex mutex; /* prevent races during read/write */
|
|
|
|
struct device *dev;
|
|
|
|
void *private_data;
|
|
};
|
|
|
|
/* Basic operations */
|
|
struct c2port_ops {
|
|
/* Flash layout */
|
|
unsigned short block_size; /* flash block size in bytes */
|
|
unsigned short blocks_num; /* flash blocks number */
|
|
|
|
/* Enable or disable the access to C2 port */
|
|
void (*access)(struct c2port_device *dev, int status);
|
|
|
|
/* Set C2D data line as input/output */
|
|
void (*c2d_dir)(struct c2port_device *dev, int dir);
|
|
|
|
/* Read/write C2D data line */
|
|
int (*c2d_get)(struct c2port_device *dev);
|
|
void (*c2d_set)(struct c2port_device *dev, int status);
|
|
|
|
/* Write C2CK clock line */
|
|
void (*c2ck_set)(struct c2port_device *dev, int status);
|
|
};
|
|
|
|
/*
|
|
* Exported functions
|
|
*/
|
|
|
|
extern struct c2port_device *c2port_device_register(char *name,
|
|
struct c2port_ops *ops, void *devdata);
|
|
extern void c2port_device_unregister(struct c2port_device *dev);
|