2 * linux/drivers/mfd/mcp.h
4 * Copyright (C) 2001 Russell King, All Rights Reserved.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License.
20 unsigned int sclk_rate
;
21 unsigned int rw_timeout
;
22 struct device attached_device
;
26 void (*set_telecom_divisor
)(struct mcp
*, unsigned int);
27 void (*set_audio_divisor
)(struct mcp
*, unsigned int);
28 void (*reg_write
)(struct mcp
*, unsigned int, unsigned int);
29 unsigned int (*reg_read
)(struct mcp
*, unsigned int);
30 void (*enable
)(struct mcp
*);
31 void (*disable
)(struct mcp
*);
34 void mcp_set_telecom_divisor(struct mcp
*, unsigned int);
35 void mcp_set_audio_divisor(struct mcp
*, unsigned int);
36 void mcp_reg_write(struct mcp
*, unsigned int, unsigned int);
37 unsigned int mcp_reg_read(struct mcp
*, unsigned int);
38 void mcp_enable(struct mcp
*);
39 void mcp_disable(struct mcp
*);
40 #define mcp_get_sclk_rate(mcp) ((mcp)->sclk_rate)
42 struct mcp
*mcp_host_alloc(struct device
*, size_t);
43 int mcp_host_add(struct mcp
*, void *);
44 void mcp_host_del(struct mcp
*);
45 void mcp_host_free(struct mcp
*);
48 struct device_driver drv
;
49 int (*probe
)(struct mcp
*);
50 void (*remove
)(struct mcp
*);
53 int mcp_driver_register(struct mcp_driver
*);
54 void mcp_driver_unregister(struct mcp_driver
*);
56 #define mcp_get_drvdata(mcp) dev_get_drvdata(&(mcp)->attached_device)
57 #define mcp_set_drvdata(mcp,d) dev_set_drvdata(&(mcp)->attached_device, d)
59 static inline void *mcp_priv(struct mcp
*mcp
)