Re: [PATCH 01/33] add lp5521 driver

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

 



On Saturday 30 August 2008, Felipe Balbi wrote:
> +static int lp5521_configure(struct i2c_client *client)
> +{
> +       int ret = 0;
> +
> +       /* Enable chip and set light to logarithmic mode*/
> +       ret |= lp5521_write(client, LP5521_REG_ENABLE, 0xc0);
> +
> +       /* setting all color pwms to direct control mode */
> +       ret |= lp5521_write(client, LP5521_REG_OP_MODE, 0x3f);
> +
> +       /* setting current to 4.7 mA for all channels */
> +       ret |= lp5521_write(client, LP5521_REG_R_CNTRL, LP5521_CURRENT_4m7);
> +       ret |= lp5521_write(client, LP5521_REG_G_CNTRL, LP5521_CURRENT_4m7);
> +       ret |= lp5521_write(client, LP5521_REG_B_CNTRL, LP5521_CURRENT_4m7);
> +
> +       /* Enable auto-powersave, set charge pump to auto, red to battery */
> +       ret |= lp5521_write(client, LP5521_REG_MISC, 0x3c);
> +

This highlights one reason many of these drivers haven't gone
upstream: embedding non-general assumptions.  In this case it
should be simple enough to define platform data to represent
various options like these ...

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux