Re: [PATCH] [MISC] Add HTC PLD driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux