Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Internal interface between the core pin control system and the |
| 3 | * pinmux portions |
| 4 | * |
| 5 | * Copyright (C) 2011 ST-Ericsson SA |
| 6 | * Written on behalf of Linaro for ST-Ericsson |
| 7 | * Based on bits of regulator core, gpio core and clk core |
| 8 | * |
| 9 | * Author: Linus Walleij <linus.walleij@linaro.org> |
| 10 | * |
| 11 | * License terms: GNU General Public License (GPL) version 2 |
| 12 | */ |
| 13 | #ifdef CONFIG_PINMUX |
| 14 | |
Tony Lindgren | b9130b7 | 2012-01-24 16:28:08 -0800 | [diff] [blame] | 15 | int pinmux_check_ops(struct pinctrl_dev *pctldev); |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame^] | 16 | |
Linus Walleij | befe5bd | 2012-02-09 19:47:48 +0100 | [diff] [blame] | 17 | int pinmux_request_gpio(struct pinctrl_dev *pctldev, |
| 18 | struct pinctrl_gpio_range *range, |
| 19 | unsigned pin, unsigned gpio); |
| 20 | void pinmux_free_gpio(struct pinctrl_dev *pctldev, unsigned pin, |
| 21 | struct pinctrl_gpio_range *range); |
| 22 | int pinmux_gpio_direction(struct pinctrl_dev *pctldev, |
| 23 | struct pinctrl_gpio_range *range, |
| 24 | unsigned pin, bool input); |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame^] | 25 | |
| 26 | int pinmux_map_to_setting(struct pinctrl_map const *map, |
| 27 | struct pinctrl_setting *setting); |
| 28 | void pinmux_free_setting(struct pinctrl_setting const *setting); |
| 29 | int pinmux_enable_setting(struct pinctrl_setting const *setting); |
| 30 | void pinmux_disable_setting(struct pinctrl_setting const *setting); |
| 31 | |
| 32 | void pinmux_dbg_show(struct seq_file *s, struct pinctrl_setting const *setting); |
Stephen Warren | 03665e0 | 2012-02-19 23:45:45 -0700 | [diff] [blame] | 33 | void pinmux_init_device_debugfs(struct dentry *devroot, |
| 34 | struct pinctrl_dev *pctldev); |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 35 | |
| 36 | #else |
| 37 | |
Tony Lindgren | b9130b7 | 2012-01-24 16:28:08 -0800 | [diff] [blame] | 38 | static inline int pinmux_check_ops(struct pinctrl_dev *pctldev) |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 39 | { |
| 40 | return 0; |
| 41 | } |
| 42 | |
Linus Walleij | befe5bd | 2012-02-09 19:47:48 +0100 | [diff] [blame] | 43 | static inline int pinmux_request_gpio(struct pinctrl_dev *pctldev, |
| 44 | struct pinctrl_gpio_range *range, |
| 45 | unsigned pin, unsigned gpio) |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 46 | { |
| 47 | return 0; |
| 48 | } |
| 49 | |
Linus Walleij | befe5bd | 2012-02-09 19:47:48 +0100 | [diff] [blame] | 50 | static inline void pinmux_free_gpio(struct pinctrl_dev *pctldev, |
| 51 | unsigned pin, |
| 52 | struct pinctrl_gpio_range *range) |
| 53 | { |
| 54 | } |
| 55 | |
| 56 | static inline int pinmux_gpio_direction(struct pinctrl_dev *pctldev, |
| 57 | struct pinctrl_gpio_range *range, |
| 58 | unsigned pin, bool input) |
| 59 | { |
| 60 | return 0; |
| 61 | } |
| 62 | |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame^] | 63 | static inline int pinmux_map_to_setting(struct pinctrl_map const *map, |
| 64 | struct pinctrl_setting *setting) |
Linus Walleij | befe5bd | 2012-02-09 19:47:48 +0100 | [diff] [blame] | 65 | { |
| 66 | return 0; |
| 67 | } |
| 68 | |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame^] | 69 | static inline void pinmux_free_setting(struct pinctrl_setting const *setting) |
Linus Walleij | befe5bd | 2012-02-09 19:47:48 +0100 | [diff] [blame] | 70 | { |
| 71 | } |
| 72 | |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame^] | 73 | static inline int pinmux_enable_setting(struct pinctrl_setting const *setting) |
Linus Walleij | befe5bd | 2012-02-09 19:47:48 +0100 | [diff] [blame] | 74 | { |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame^] | 75 | return 0; |
Linus Walleij | befe5bd | 2012-02-09 19:47:48 +0100 | [diff] [blame] | 76 | } |
| 77 | |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame^] | 78 | static inline void pinmux_disable_setting( |
| 79 | struct pinctrl_setting const *setting) |
Linus Walleij | befe5bd | 2012-02-09 19:47:48 +0100 | [diff] [blame] | 80 | { |
| 81 | } |
| 82 | |
Stephen Warren | 03665e0 | 2012-02-19 23:45:45 -0700 | [diff] [blame] | 83 | static inline void pinmux_init_device_debugfs(struct dentry *devroot, |
| 84 | struct pinctrl_dev *pctldev) |
| 85 | { |
| 86 | } |
| 87 | |
| 88 | static inline void pinmux_dbg_show(struct seq_file *s, struct pinctrl *p) |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 89 | { |
| 90 | } |
| 91 | |
| 92 | #endif |