4 * Copyright (C) 2008 Google, Inc.
5 * Author: Mike Lockwood <lockwood@android.com>
7 * This software is licensed under the terms of the GNU General Public
8 * License version 2, as published by the Free Software Foundation, and
9 * may be copied, distributed, and modified under those terms.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
18 #ifndef __LINUX_SWITCH_H__
19 #define __LINUX_SWITCH_H__
27 ssize_t (*print_name
)(struct switch_dev
*sdev
, char *buf
);
28 ssize_t (*print_state
)(struct switch_dev
*sdev
, char *buf
);
31 struct gpio_switch_platform_data
{
35 /* if NULL, switch_dev.name will be printed */
38 /* if NULL, "0" or "1" will be printed */
40 const char *state_off
;
43 extern int switch_dev_register(struct switch_dev
*sdev
);
44 extern void switch_dev_unregister(struct switch_dev
*sdev
);
46 static inline int switch_get_state(struct switch_dev
*sdev
)
51 extern void switch_set_state(struct switch_dev
*sdev
, int state
);
53 #endif /* __LINUX_SWITCH_H__ */