提交 277b95a9 编写于 作者: A Andy Shevchenko

pinctrl: intel: Embed struct pingroup into struct intel_pingroup

Add a new member to the struct intel_pingroup to cover generic
pin control group parameters. The idea is to convert all users
(one-by-one) to it and drop old members later on.
Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: NMika Westerberg <mika.westerberg@linux.intel.com>
上级 be753a1f
...@@ -27,14 +27,15 @@ struct device; ...@@ -27,14 +27,15 @@ struct device;
* @name: Name of the groups * @name: Name of the groups
* @pins: All pins in this group * @pins: All pins in this group
* @npins: Number of pins in this groups * @npins: Number of pins in this groups
* @mode: Native mode in which the group is muxed out @pins. Used if @modes * @grp: Generic data of the pin group (name and pins)
* is %NULL. * @mode: Native mode in which the group is muxed out @pins. Used if @modes is %NULL.
* @modes: If not %NULL this will hold mode for each pin in @pins * @modes: If not %NULL this will hold mode for each pin in @pins
*/ */
struct intel_pingroup { struct intel_pingroup {
const char *name; const char *name;
const unsigned int *pins; const unsigned int *pins;
size_t npins; size_t npins;
struct pingroup grp;
unsigned short mode; unsigned short mode;
const unsigned int *modes; const unsigned int *modes;
}; };
...@@ -156,15 +157,14 @@ struct intel_community { ...@@ -156,15 +157,14 @@ struct intel_community {
* a single integer or an array of integers in which case mode is per * a single integer or an array of integers in which case mode is per
* pin. * pin.
*/ */
#define PIN_GROUP(n, p, m) \ #define PIN_GROUP(n, p, m) \
{ \ { \
.name = (n), \ .name = (n), \
.pins = (p), \ .pins = (p), \
.npins = ARRAY_SIZE((p)), \ .npins = ARRAY_SIZE((p)), \
.mode = __builtin_choose_expr( \ .grp = PINCTRL_PINGROUP((n), (p), ARRAY_SIZE((p))), \
__builtin_constant_p((m)), (m), 0), \ .mode = __builtin_choose_expr(__builtin_constant_p((m)), (m), 0), \
.modes = __builtin_choose_expr( \ .modes = __builtin_choose_expr(__builtin_constant_p((m)), NULL, (m)), \
__builtin_constant_p((m)), NULL, (m)), \
} }
#define FUNCTION(n, g) \ #define FUNCTION(n, g) \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册