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: <20141226172627.GB24756@amd>
Date:	Fri, 26 Dec 2014 18:26:27 +0100
From:	Pavel Machek <pavel@....cz>
To:	Sebastian Reichel <sre@...nel.org>
Cc:	Pali Rohar <pali.rohar@...il.com>, Jean Delvare <jdelvare@...e.de>,
	Guenter Roeck <linux@...ck-us.net>,
	Tony Lindgren <tony@...mide.com>,
	BenoƮt Cousson <bcousson@...libre.com>,
	linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
	linux-omap@...r.kernel.org, lm-sensors@...sensors.org,
	devicetree@...r.kernel.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>
Subject: Re: [PATCH 2/3] hwmon: Driver for OMAP3 temperature sensor

On Fri 2014-12-26 13:34:53, Sebastian Reichel wrote:
> OMAP34xx and OMAP36xx processors contain a register in the syscon area,
> which can be used to determine the SoCs temperature. This patch provides
> a DT based driver for the temperature sensor based on an older driver
> written by Peter De Schrijver for the Nokia N900 and N9.
> 
> Signed-off-by: Sebastian Reichel <sre@...nel.org>

> +	if (!data->valid || time_after(jiffies, data->last_updated + HZ)) {
> +		clk_enable(data->clk_32k);

This needs to be clk_prepare_enable()

> +		regmap_update_bits(data->syscon, SYSCON_TEMP_REG,
> +				   soc_mask, soc_mask);
> +
> +		if (!wait_for_eocz(EOCZ_MIN_RISING_DELAY,
> +		    EOCZ_MAX_RISING_DELAY, 1, data)) {
> +			e = -EIO;
> +			goto err;
> +		}
> +
> +		regmap_update_bits(data->syscon, SYSCON_TEMP_REG, soc_mask, 0);
> +
> +		if (!wait_for_eocz(EOCZ_MIN_FALLING_DELAY,
> +		    EOCZ_MAX_FALLING_DELAY, 0, data)) {
> +			e = -EIO;
> +			goto err;
> +		}
> +
> +		regmap_read(data->syscon, SYSCON_TEMP_REG, &temp_sensor_reg);
> +		data->temperature = temp_sensor_reg & ((1<<7) - 1);
> +		data->last_updated = jiffies;
> +		data->valid = true;
> +
> +err:
> +		clk_disable(data->clk_32k);

And this clk_disable_unprepare().

									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
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