~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/pinctrl/machine.h

Version: ~ [ linux-5.1-rc2 ] ~ [ linux-5.0.4 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.31 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.108 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.165 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.177 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.137 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.63 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.39.4 ] ~ [ linux-2.6.38.8 ] ~ [ linux-2.6.37.6 ] ~ [ linux-2.6.36.4 ] ~ [ linux-2.6.35.14 ] ~ [ linux-2.6.34.15 ] ~ [ linux-2.6.33.20 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * Machine interface for the pinctrl subsystem.
  3  *
  4  * Copyright (C) 2011 ST-Ericsson SA
  5  * Written on behalf of Linaro for ST-Ericsson
  6  * Based on bits of regulator core, gpio core and clk core
  7  *
  8  * Author: Linus Walleij <linus.walleij@linaro.org>
  9  *
 10  * License terms: GNU General Public License (GPL) version 2
 11  */
 12 #ifndef __LINUX_PINMUX_MACHINE_H
 13 #define __LINUX_PINMUX_MACHINE_H
 14 
 15 /**
 16  * struct pinmux_map - boards/machines shall provide this map for devices
 17  * @name: the name of this specific map entry for the particular machine.
 18  *      This is the second parameter passed to pinmux_get() when you want
 19  *      to have several mappings to the same device
 20  * @ctrl_dev: the pin control device to be used by this mapping, may be NULL
 21  *      if you provide .ctrl_dev_name instead (this is more common)
 22  * @ctrl_dev_name: the name of the device controlling this specific mapping,
 23  *      the name must be the same as in your struct device*, may be NULL if
 24  *      you provide .ctrl_dev instead
 25  * @function: a function in the driver to use for this mapping, the driver
 26  *      will lookup the function referenced by this ID on the specified
 27  *      pin control device
 28  * @group: sometimes a function can map to different pin groups, so this
 29  *      selects a certain specific pin group to activate for the function, if
 30  *      left as NULL, the first applicable group will be used
 31  * @dev: the device using this specific mapping, may be NULL if you provide
 32  *      .dev_name instead (this is more common)
 33  * @dev_name: the name of the device using this specific mapping, the name
 34  *      must be the same as in your struct device*, may be NULL if you
 35  *      provide .dev instead
 36  * @hog_on_boot: if this is set to true, the pin control subsystem will itself
 37  *      hog the mappings as the pinmux device drivers are attached, so this is
 38  *      typically used with system maps (mux mappings without an assigned
 39  *      device) that you want to get hogged and enabled by default as soon as
 40  *      a pinmux device supporting it is registered. These maps will not be
 41  *      disabled and put until the system shuts down.
 42  */
 43 struct pinmux_map {
 44         const char *name;
 45         struct device *ctrl_dev;
 46         const char *ctrl_dev_name;
 47         const char *function;
 48         const char *group;
 49         struct device *dev;
 50         const char *dev_name;
 51         bool hog_on_boot;
 52 };
 53 
 54 /*
 55  * Convenience macro to set a simple map from a certain pin controller and a
 56  * certain function to a named device
 57  */
 58 #define PINMUX_MAP(a, b, c, d) \
 59         { .name = a, .ctrl_dev_name = b, .function = c, .dev_name = d }
 60 
 61 /*
 62  * Convenience macro to map a system function onto a certain pinctrl device.
 63  * System functions are not assigned to a particular device.
 64  */
 65 #define PINMUX_MAP_SYS(a, b, c) \
 66         { .name = a, .ctrl_dev_name = b, .function = c }
 67 
 68 /*
 69  * Convenience macro to map a system function onto a certain pinctrl device,
 70  * to be hogged by the pinmux core until the system shuts down.
 71  */
 72 #define PINMUX_MAP_SYS_HOG(a, b, c) \
 73         { .name = a, .ctrl_dev_name = b, .function = c, \
 74           .hog_on_boot = true }
 75 
 76 /*
 77  * Convenience macro to map a system function onto a certain pinctrl device
 78  * using a specified group, to be hogged by the pinmux core until the system
 79  * shuts down.
 80  */
 81 #define PINMUX_MAP_SYS_HOG_GROUP(a, b, c, d)            \
 82         { .name = a, .ctrl_dev_name = b, .function = c, .group = d, \
 83           .hog_on_boot = true }
 84 
 85 #ifdef CONFIG_PINMUX
 86 
 87 extern int pinmux_register_mappings(struct pinmux_map const *map,
 88                                 unsigned num_maps);
 89 
 90 #else
 91 
 92 static inline int pinmux_register_mappings(struct pinmux_map const *map,
 93                                            unsigned num_maps)
 94 {
 95         return 0;
 96 }
 97 
 98 #endif /* !CONFIG_PINMUX */
 99 #endif
100 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp