lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdYJyUE-gM+wnOQvqW4Txuf65kEJsUbdJcBhkzRZYCxYDQ@mail.gmail.com>
Date:	Mon, 21 May 2012 23:30:28 +0200
From:	Linus Walleij <linus.walleij@...aro.org>
To:	Uwe Kleine-König 
	<u.kleine-koenig@...gutronix.de>
Cc:	Bryan Wu <bryan.wu@...onical.com>,
	Richard Purdie <rpurdie@...ys.net>, kernel@...gutronix.de,
	linux-kernel@...r.kernel.org,
	Grant Likely <grant.likely@...retlab.ca>,
	Linus Walleij <linus.walleij@...ricsson.com>
Subject: Re: [PATCH v3] leds: Add MAX6956 driver

On Mon, May 21, 2012 at 9:33 PM, Uwe Kleine-König
<u.kleine-koenig@...gutronix.de> wrote:

> +config LEDS_MAX6956
> +       tristate "LED support for MAX6956 LED Display Driver and I/O Expander"
> +       depends on LEDS_CLASS
> +       depends on GPIOLIB

Shouldn't this be select GPIOLIB?

You seem to require it when using this driver.

Better than hiding it if not selecting GPIOLIB somewhere else?

> +struct max6956_ddata {
> +       struct device *dev;
> +
> +       struct mutex lock;
> +
> +       struct regmap *regmap;
> +
> +       struct gpio_chip gpio_chip;
> +
> +       struct max6956_pdata pdata;
> +
> +       struct max6956_led_ddata leds[32];
> +
> +       const char *gpio_names[32];
> +};

You can never have enough whitespace? ;-)

Anyway, so this thing has a gpio_chip and leds.

The archaic way is to create mfd/max-6956.c and have this
MFD device spawn two cells, one for GPIO landing in
driver/gpio/gpio-max6956.c and one for LED landing in
leds/leds-max6956.c, then mediate register read/writes and
regmap in the MFD driver.

The MFD driver decide using platform data whether each
line should be used for a LED or GPIO.

Is there some problem with this design pattern?

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ