2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-29 23:53:55 +08:00
linux-next/include/linux/c2port.h
Paul Gortmaker 313162d0b8 device.h: audit and cleanup users in main include dir
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>
2012-03-16 10:38:24 -04:00

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);