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: <53E0350C.4020003@codeaurora.org>
Date:	Mon, 04 Aug 2014 18:36:12 -0700
From:	Stephen Boyd <sboyd@...eaurora.org>
To:	"Ivan T. Ivanov" <iivanov@...sol.com>
CC:	David Collins <collinsd@...eaurora.org>,
	Linus Walleij <linus.walleij@...aro.org>,
	Rob Herring <robh+dt@...nel.org>,
	Pawel Moll <pawel.moll@....com>,
	Mark Rutland <mark.rutland@....com>,
	Ian Campbell <ijc+devicetree@...lion.org.uk>,
	Kumar Gala <galak@...eaurora.org>,
	Grant Likely <grant.likely@...aro.org>,
	Bjorn Andersson <bjorn.andersson@...ymobile.com>,
	Mark Brown <broonie@...nel.org>, linux-kernel@...r.kernel.org,
	devicetree@...r.kernel.org, linux-arm-msm@...r.kernel.org
Subject: Re: [PATCH v2 2/4] pinctrl: qpnp: Qualcomm PMIC pin controller driver

On 07/28/14 01:39, Ivan T. Ivanov wrote:
> I am working on proposal from Stephen Boyd to encode GPIO/MPP mode and 
> source select into combined function. Something like this one:
>
> #define PM8XXX_DIGITAL_IN		0
> #define PM8XXX_DIGITAL_OUT		1
> #define PM8XXX_DIGITAL_IN_OUT		2
>
> ...
>
> /* mode and source select */
> #define PM8XXX_FUNCTION(m,s)		((m) << 16 | (s))
>
> #define PM8921_GPIO1_14_KYPD_SNS	PM8XXX_FUNCTION(PM8XXX_DIGITAL_IN, 1)
> #define PM8921_GPIO9_14_KYPD_DRV	PM8XXX_FUNCTION(PM8XXX_DIGITAL_OUT, 1)
> #define PM8921_GPIO33_35_PWM		PM8XXX_FUNCTION(PM8XXX_DIGITAL_OUT, 3)
>
> ..
>
>

This isn't what I was suggesting at all. The function should be
something like KYPD, PWM and those should just be defined to be 1 or 3.
The mode should be some other property like input or output, and the
driver should or the two together and put it into the register.
Basically we shouldn't see any shifts or ors in the #defines, just
convenient numbers that correspond to the value of the field in the
register.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation

--
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