mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
[PATCH] chardev: GPIO for SCx200 & PC-8736x: use dev_dbg in common module
Use of dev_dbg() and friends is considered good practice. dev_dbg() needs a struct device *devp, but nsc_gpio is only a helper module, so it doesnt have/need its own. To provide devp to the user-modules (scx200 & pc8736x _gpio), we add it to the vtable, and set it during init. Also squeeze nsc_gpio_dump()'s format a little. [ 199.259879] pc8736x_gpio.0: io09: 0x0044 TS OD PUE EDGE LO DEBOUNCE Signed-off-by: Jim Cromie <jim.cromie@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
58b087cda1
commit
f31000e573
4 changed files with 34 additions and 31 deletions
|
@ -22,13 +22,14 @@
|
|||
struct nsc_gpio_ops {
|
||||
struct module* owner;
|
||||
u32 (*gpio_config) (unsigned iminor, u32 mask, u32 bits);
|
||||
void (*gpio_dump) (unsigned iminor);
|
||||
void (*gpio_dump) (struct nsc_gpio_ops *amp, unsigned iminor);
|
||||
int (*gpio_get) (unsigned iminor);
|
||||
void (*gpio_set) (unsigned iminor, int state);
|
||||
void (*gpio_set_high)(unsigned iminor);
|
||||
void (*gpio_set_low) (unsigned iminor);
|
||||
void (*gpio_change) (unsigned iminor);
|
||||
int (*gpio_current) (unsigned iminor);
|
||||
struct device* dev; /* for dev_dbg() support, set in init */
|
||||
};
|
||||
|
||||
extern ssize_t nsc_gpio_write(struct file *file, const char __user *data,
|
||||
|
@ -36,3 +37,6 @@ extern ssize_t nsc_gpio_write(struct file *file, const char __user *data,
|
|||
|
||||
extern ssize_t nsc_gpio_read(struct file *file, char __user *buf,
|
||||
size_t len, loff_t *ppos);
|
||||
|
||||
extern void nsc_gpio_dump(struct nsc_gpio_ops *amp, unsigned index);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue