From: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
To: Cory Maccarrone <darkstar6262-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] [MISC] Add HTC PLD driver
Date: Mon, 7 Dec 2009 14:13:29 +0100 [thread overview]
Message-ID: <20091207141329.3dd3411c@hyperion.delvare> (raw)
In-Reply-To: <1260083683-13095-1-git-send-email-darkstar6262-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
On Sat, 5 Dec 2009 23:14:43 -0800, Cory Maccarrone wrote:
> diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
> index df1f86b..be6109e 100644
> --- a/drivers/misc/Kconfig
> +++ b/drivers/misc/Kconfig
> @@ -246,6 +246,17 @@ config EP93XX_PWM
> To compile this driver as a module, choose M here: the module will
> be called ep93xx_pwm.
>
> +config HTCPLD
> + tristate "HTC Wizard/Herald CPLD"
> + depends on I2C=y
I'm curious why your driver wouldn't work when I2C support is modular.
> + help
> + If you say yes here you get support for the supposed CPLD
> + found on omap850 HTC devices like the HTC Wizard and HTC Herald.
> + This device controls backlight, leds, rumble and also the dpad.
> +
> + To compile this driver as a module, choose M here: the module will
> + be called htcpld.
> (...)
> diff --git a/drivers/misc/htcpld.c b/drivers/misc/htcpld.c
> new file mode 100644
> index 0000000..97a0260
> --- /dev/null
> +++ b/drivers/misc/htcpld.c
> @@ -0,0 +1,204 @@
> (...)
> +
> +#include <linux/kernel.h>
> +#include <linux/init.h>
> +#include <linux/module.h>
> +#include <linux/input.h>
> +#include <linux/interrupt.h>
> +#include <linux/timer.h>
> +#include <linux/platform_device.h>
I fail to see why you need to include that one.
> +#include <linux/i2c.h>
> +
> +#include <linux/htcpld.h>
> +
> +#define HTCPLD_ADDR_MAX 16
This define is the sure sign that your driver is badly designed. You
shouldn't have to set any such arbitrary limit...
> (...)
> +static struct i2c_client *htcpld_chip[HTCPLD_ADDR_MAX];
... because you shouldn't have to rely on a global like that in the
first place.
--
Jean Delvare
next prev parent reply other threads:[~2009-12-07 13:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-06 7:14 [PATCH] [MISC] Add HTC PLD driver Cory Maccarrone
[not found] ` <1260083683-13095-1-git-send-email-darkstar6262-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-12-07 12:49 ` Mark Brown
2009-12-07 13:13 ` Jean Delvare [this message]
[not found] ` <20091207141329.3dd3411c-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-12-12 21:02 ` Cory Maccarrone
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=20091207141329.3dd3411c@hyperion.delvare \
--to=khali-puyad+kwke1g9huczpvpmw@public.gmane.org \
--cc=darkstar6262-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).