From: Lee Jones <lee.jones@linaro.org>
To: Alexander Shiyan <shc_work@mail.ru>
Cc: linux-input@vger.kernel.org,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Shawn Guo <shawn.guo@linaro.org>,
Sascha Hauer <kernel@pengutronix.de>,
Samuel Ortiz <sameo@linux.intel.com>
Subject: Re: [PATCH 1/4] input: mc13783: Make mc13xxx_buttons_platform_data more flexible
Date: Mon, 10 Feb 2014 11:29:17 +0000 [thread overview]
Message-ID: <20140210112917.GD21522@lee--X1> (raw)
In-Reply-To: <1392006129-10227-1-git-send-email-shc_work@mail.ru>
> Instead of define each button in separate variable, make an array
> for storing all buttons. This change will help to add support for
> other types of PMIC and add support for probing with devicetree
> in the future.
>
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
> ---
> arch/arm/mach-imx/mach-mx31moboard.c | 9 ++++--
> drivers/input/misc/mc13783-pwrbutton.c | 56 +++++++++++++++++-----------------
> include/linux/mfd/mc13xxx.h | 28 +++++++++--------
Are all the changes in these files entangled? If there is any way to
make them orthogonal, then all the better.
<snip>
> --- a/include/linux/mfd/mc13xxx.h
> +++ b/include/linux/mfd/mc13xxx.h
> @@ -172,20 +172,22 @@ struct mc13xxx_leds_platform_data {
> u32 led_control[MAX_LED_CONTROL_REGS];
> };
>
> +#define MAX13XXX_NUM_BUTTONS 3
> +
> +struct mc13xxx_button {
> + u16 keycode;
> + unsigned int flags;
> +#define MC13XXX_BUTTON_DBNC_0MS 0
> +#define MC13XXX_BUTTON_DBNC_30MS 1
> +#define MC13XXX_BUTTON_DBNC_150MS 2
> +#define MC13XXX_BUTTON_DBNC_750MS 3
> +#define MC13XXX_BUTTON_ENABLE (1 << 2)
> +#define MC13XXX_BUTTON_POL_INVERT (1 << 3)
> +#define MC13XXX_BUTTON_RESET_EN (1 << 4)
> +};
> +
Please take the opportunity to remove this slab list of #defines from
the centre of the struct definition. Just above will be fine.
> struct mc13xxx_buttons_platform_data {
> -#define MC13783_BUTTON_DBNC_0MS 0
> -#define MC13783_BUTTON_DBNC_30MS 1
> -#define MC13783_BUTTON_DBNC_150MS 2
> -#define MC13783_BUTTON_DBNC_750MS 3
> -#define MC13783_BUTTON_ENABLE (1 << 2)
> -#define MC13783_BUTTON_POL_INVERT (1 << 3)
> -#define MC13783_BUTTON_RESET_EN (1 << 4)
> - int b1on_flags;
> - unsigned short b1on_key;
> - int b2on_flags;
> - unsigned short b2on_key;
> - int b3on_flags;
> - unsigned short b3on_key;
> + struct mc13xxx_button buttons[MAX13XXX_NUM_BUTTONS];
> };
>
> struct mc13xxx_ts_platform_data {
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-02-10 11:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-10 4:22 [PATCH 1/4] input: mc13783: Make mc13xxx_buttons_platform_data more flexible Alexander Shiyan
2014-02-10 11:29 ` Lee Jones [this message]
2014-02-11 6:46 ` Alexander Shiyan
2014-02-11 9:17 ` Lee Jones
2014-02-11 9:42 ` Alexander Shiyan
2014-02-11 10:07 ` Lee Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140210112917.GD21522@lee--X1 \
--to=lee.jones@linaro.org \
--cc=dmitry.torokhov@gmail.com \
--cc=kernel@pengutronix.de \
--cc=linux-input@vger.kernel.org \
--cc=sameo@linux.intel.com \
--cc=shawn.guo@linaro.org \
--cc=shc_work@mail.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.