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]
Date:	Thu, 17 Nov 2011 01:40:07 +0400
From:	Anton Vorontsov <cbouatmailru@...il.com>
To:	H Hartley Sweeten <hartleys@...ionengravers.com>
Cc:	Linux Kernel <linux-kernel@...r.kernel.org>,
	grant.likely@...retlab.ca, jamie@...ieiles.com,
	akpm@...ux-foundation.org, rmk+kernel@....linux.org.uk
Subject: Re: basic_mmio_gpio: Add hook for simple debounce register

Hello,

On Wed, Nov 16, 2011 at 12:02:15PM -0700, H Hartley Sweeten wrote:
> Some platforms using the basic memory-mapped GPIO library have
> simple input debounce support that is enabled/disabled, per-input,
> by setting/clearing bits in a control register. Add a hook in the
> bgpio_chip structure to hold the void __iomem * for this register.
> 
> This register, and the gc.set_debounce callback should set by the
> platform after calling bgpio_init() and before calling gpiochip_add().

I think it is possible to add 'reg_db' into the device-specific
(private) structure, so no need to add it into the generic one
(the fact that the generic gpio code does not use it at all, is a
sign that you should place it into a private struct).

I.e. something like this:

struct foo_chip {
	struct bgpio_chip bgc;
	void __iomem *reg_db;
};

static struct foo_chip *to_foo_chip(struct bgpio_chip *bgc)
{
	return container_of(bgc, struct foo_chip, bgc);
}

static void foo_gpio_set_debounce(struct gpio_chip *gc, ...)
{
	struct bgpio_chip *bgc = to_bgpio_chip(gc);
	struct foo_chip *fgc = to_foo_chip(bgc);

	writel(..., fgc->reg_db);
}


Or, if the generic code will use that register, then please introduce
the code at the same time you introduce reg_db.

Thanks,

-- 
Anton Vorontsov
Email: cbouatmailru@...il.com
--
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