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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdZVDYgLSW9vbauptb0p_nnhUfrgtVkSx_wMRbpP1XPybQ@mail.gmail.com>
Date:	Tue, 7 Jan 2014 15:11:11 +0100
From:	Linus Walleij <linus.walleij@...aro.org>
To:	Laszlo Papp <lpapp@....org>, Mark Brown <broonie@...aro.org>,
	Samuel Ortiz <sameo@...ux.intel.com>
Cc:	Guenter Roeck <linux@...ck-us.net>,
	Lee Jones <lee.jones@...aro.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/3] mfd: MAX6650/6651 support

On Mon, Dec 23, 2013 at 5:08 PM, Laszlo Papp <lpapp@....org> wrote:

> MAX6650/MAX6651 chip is a multi-function device with I2C busses. The
> chip includes fan-speed regulators and monitors, GPIO, and alarm.
>
> This patch is an initial release of a MAX6650/6651 MFD driver that
> supports to enable the chip with its primary I2C bus that will connect
> the hwmon, and then the gpio devices for now.
>
> Signed-off-by: Laszlo Papp <lpapp@....org>
(...)
> +++ b/include/linux/mfd/max6651-private.h
> +struct max6651_dev {
> +    struct device *dev;
> +    struct mutex iolock;
> +
> +    struct i2c_client *i2c;
> +
> +       int type;
> +};
> +
> +enum max6651_types {
> +       TYPE_MAX6650,
> +       TYPE_MAX6651,
> +};
> +
> +extern int max6651_read_reg(struct i2c_client *i2c, u8 reg, u8 *dest);
> +extern int max6651_write_reg(struct i2c_client *i2c, u8 reg, u8 value);

It looks like you're reinventing regmap.

- In the Kconfig entry for the MFD device:
  select REGMAP_I2C

- Look in drivers/mfd/stw481x.c for an example using
  <linux/regmap.h>

- Look into
  drivers/regulator/stw481x-vmmc.c
  for an example regmap MFD spawned child cell.

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