summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Weber <xmw@gentoo.org>2013-09-05 13:08:57 +0000
committerMichael Weber <xmw@gentoo.org>2013-09-05 13:08:57 +0000
commita03d7d1bd877d04572491c1672fd865de57bd1bd (patch)
tree8f6b0ea2de5783cb0ea0455f1da4f5a0f6deb3da
parentAdd some Prefix keywords (diff)
downloadhistorical-a03d7d1bd877d04572491c1672fd865de57bd1bd.tar.gz
historical-a03d7d1bd877d04572491c1672fd865de57bd1bd.tar.bz2
historical-a03d7d1bd877d04572491c1672fd865de57bd1bd.zip
Version bump for 3.11 kernels. Switch to patches maintained by Dirk "ion" in phc-intel-pack-rev11.tar.bz2. Drop old versions. Ebuild cleanup.
Package-Manager: portage-2.2.0/cvs/Linux x86_64 Manifest-Sign-Key: 0x62EEF090
-rw-r--r--sys-power/phc-intel/ChangeLog20
-rw-r--r--sys-power/phc-intel/Manifest24
-rw-r--r--sys-power/phc-intel/files/phc-intel-0.3.2.12.1-2.6.35.patch529
-rw-r--r--sys-power/phc-intel/files/phc-intel-0.3.2.12.1-2.6.36.patch529
-rw-r--r--sys-power/phc-intel/files/phc-intel-0.3.2.12.1-2.6.37.patch528
-rw-r--r--sys-power/phc-intel/files/phc-intel-0.3.2.12.1-3.7.patch534
-rw-r--r--sys-power/phc-intel/files/phc-intel-0.3.2.12.11-trailing-space.patch11
-rw-r--r--sys-power/phc-intel/phc-intel-0.3.199.11_pre.ebuild60
-rw-r--r--sys-power/phc-intel/phc-intel-0.3.199.3_pre.ebuild39
-rw-r--r--sys-power/phc-intel/phc-intel-0.3.2.12.1-r3.ebuild58
-rw-r--r--sys-power/phc-intel/phc-intel-0.3.2.12.1-r4.ebuild60
-rw-r--r--sys-power/phc-intel/phc-intel-0.3.2.12.1-r5.ebuild9
-rw-r--r--sys-power/phc-intel/phc-intel-0.3.2.12.11.ebuild62
13 files changed, 167 insertions, 2296 deletions
diff --git a/sys-power/phc-intel/ChangeLog b/sys-power/phc-intel/ChangeLog
index e60038c055cb..7509e74769db 100644
--- a/sys-power/phc-intel/ChangeLog
+++ b/sys-power/phc-intel/ChangeLog
@@ -1,6 +1,21 @@
# ChangeLog for sys-power/phc-intel
-# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-power/phc-intel/ChangeLog,v 1.11 2012/12/17 07:20:10 xmw Exp $
+# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-power/phc-intel/ChangeLog,v 1.12 2013/09/05 13:08:45 xmw Exp $
+
+*phc-intel-0.3.199.11_pre (05 Sep 2013)
+*phc-intel-0.3.2.12.11 (05 Sep 2013)
+
+ 05 Sep 2013; Michael Weber <xmw@gentoo.org>
+ +files/phc-intel-0.3.2.12.11-trailing-space.patch,
+ +phc-intel-0.3.199.11_pre.ebuild, +phc-intel-0.3.2.12.11.ebuild,
+ -files/phc-intel-0.3.2.12.1-2.6.35.patch,
+ -files/phc-intel-0.3.2.12.1-2.6.36.patch,
+ -files/phc-intel-0.3.2.12.1-2.6.37.patch,
+ -files/phc-intel-0.3.2.12.1-3.7.patch, -phc-intel-0.3.199.3_pre.ebuild,
+ -phc-intel-0.3.2.12.1-r3.ebuild, -phc-intel-0.3.2.12.1-r4.ebuild,
+ files/phc-intel-0.3.2.12.1-r5-3.7.patch, phc-intel-0.3.2.12.1-r5.ebuild:
+ Version bump for 3.11 kernels. Switch to patches maintained by Dirk "ion" in
+ phc-intel-pack-rev11.tar.bz2. Drop old versions. Ebuild cleanup.
*phc-intel-0.3.2.12.1-r5 (17 Dec 2012)
@@ -59,4 +74,3 @@
24 Aug 2010; Michael Weber <xmw@gentoo.org> ChangeLog:
New ebuild for sys-power/phc-intel. Ebuild written by me, taken from
sunrise. Fixes bug #283472.
-
diff --git a/sys-power/phc-intel/Manifest b/sys-power/phc-intel/Manifest
index 37d152e4efbd..01dd2119ec8f 100644
--- a/sys-power/phc-intel/Manifest
+++ b/sys-power/phc-intel/Manifest
@@ -1,28 +1,24 @@
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
-AUX phc-intel-0.3.2.12.1-2.6.35.patch 16066 SHA256 02bfdb717629025e505c4575afe89c465ef47755223a5577842d6db3fef8e427 SHA512 d5a7590b95a1d8d4b2471ab7fb0f65fb9353b06ba0d5f5eb27a85ee870d8d57de169533fb43314eb7ce4a1c8b9ce1930077dbbbe31e1fe85b59fb9df844d299f WHIRLPOOL 3dbf7da6dda37e1e628dce1431455617eda08ea8200ef935da779057d9befffdc872718997d8f99b9afdca0284f77802daa449c68110e3dad56568a9c97251ce
-AUX phc-intel-0.3.2.12.1-2.6.36.patch 15934 SHA256 9310783980d12ababb1a5aaddd7ad2cf0c1f2f5a749a89cc32b33cfef9e49c28 SHA512 25e48428b8571138450e24779100199ff08bdb9346a68ff30a87015cb300923a62544ef87299bdab6b588d7d06a6ec0d5f0fd6638df279a5b7f9b3cd31c6c03a WHIRLPOOL d552cc5c521a98f73c66752a6c0ca9535c6031d903376eab58c4c5ca56cb6076247109c12c0a3a244ab2febac83ff87e2e480340a036246cfa9718c4cb500637
-AUX phc-intel-0.3.2.12.1-2.6.37.patch 15919 SHA256 3a58b6e56707a0b136507607818b8b58e106b1e5872c0b5b833fbddcb7c1d873 SHA512 5c9dc966a6a98718791cc28f83b7f52bd3faffb214a02c1db8e2d2cf8315b58d8505d3aa187abdef0391875d262510c7c3963ca9cbe8fd23ce8145a84cf5e6f9 WHIRLPOOL 33a54cfc2d6dd8d2019d48d2802269cc58b05e786c5a35d77e9be4a699edcc25696d4e10c40d630b70b0a51979ee9d4400bd0e8316a34a46863a4bb0955b200f
-AUX phc-intel-0.3.2.12.1-3.7.patch 16146 SHA256 f549c2ca3008e53b4f620255978bd155ee3a540e151d298495a056bc663ad692 SHA512 c66ec48b04d46ca3d20295322162c6a33b532bc0b4cb873c8033c6f3d2d8436a04099172f9f26208b8a6fbc1b10c3ab96f08aee3a03ac33bb0a6a22b1025a646 WHIRLPOOL 74a2e97f1e42313425da39bc404ac716cd85daf1d241ab596f53e27deae966eceaa8160eea0dd99034a0281519b662617d412856869dcb885c8c02b6ab18ff10
AUX phc-intel-0.3.2.12.1-r5-2.6.35.patch 16120 SHA256 7072bc44d6fdc3c1e0443f52d0dc0195c3e0fca7a2db48fb4fb8a177d0299941 SHA512 f38578e61ce0bb22fe544296988dbb3177cb41b4cfd4091cc0120a67bcbdf7c97fa6e6c2136e901e816e43de8360cbc92476144f41bd54a6cbe501b7ce3843b6 WHIRLPOOL 675f42497a45b94e169f5520de71705d42216b00537477bfe92c7b549dcd05a65c4e8190dc3faa27ee3539e34a522daecc6962193cad17d65403a4e544d13dd0
AUX phc-intel-0.3.2.12.1-r5-2.6.36.patch 15987 SHA256 3658a7e3e8f7a4a50f44a38c6e146dd5d24a5ded67d70cc93292c43c8cca3fa9 SHA512 4651dc2830e745c6fc4b0f4b6a49fa74eaed45b010b5c502d6c6d39218023b5a3a162a3630ac187b486f667e3f3d5c8d31168c71c7a333785c6738b64ad89167 WHIRLPOOL 325ae6e1b338d275b0ceaef06c61f2b0d1abc0b82ee373217c117dbc35fdc071aa2f822f07f17629e1fea2fed27e4df1871fb78df2ac14027bd4c197b2b9ff00
AUX phc-intel-0.3.2.12.1-r5-2.6.37.patch 15972 SHA256 2e214b9664b4df4c3453520f8d91a55056e61a71aec493206e948897a6dc6285 SHA512 46e4020614338e802d67544bceea9fef55d06ccbb1759c23c737066622613b7b915a24a4b26b6fea209ca8d8bfc1c44af6765ba55309cc1ff5d340d31941f8f7 WHIRLPOOL c57a3fe8cb6171c2624f9152b44848950134ad6644bb3bfce47c5e3b1f99dc8b63d528fcffd42fd8c860560ea93a8edda94096393935719bf771cd8b3631a899
AUX phc-intel-0.3.2.12.1-r5-3.7.patch 16200 SHA256 881e096e4dc74832529d32ddb55caf4c4c1c1168fac3f9e8729b4b7b9fea8176 SHA512 9c79b58428a44e073bc61fe2b6429056a27fdf1a3b1f2ba4ab29118b22d4491211f24bb049a5eaec733e77455367bac028e4e1ae4a6bd31ad99329db6f02cd85 WHIRLPOOL 579de36768e5283bd0e7378aa79e5ecd50cc48bc59a0a6b53ab0ea9f8454f44873495849ddf3f8a25adc21a13683f7c29cbd0ced9c5caee4270bc8be599d0e46
-DIST phc-intel-0.3.199.3_pre.tar.bz2 15508 SHA256 4441af7a0a1335a920b0d18a46483a64fbae8e57d98a6bdbf31dbacac2bbdf82
+AUX phc-intel-0.3.2.12.11-trailing-space.patch 353 SHA256 f0953eee285a435e9d769bc6de3daed492cb12ef083263e414cde9e3de0f870e SHA512 c4910f043068aef1a7969b48362dfcf2fcb12ed30e21f6339384568cc62f4570023a2bb56a8cae08f90052358f46ebeee2144e77a44609733eb43dfec6da741d WHIRLPOOL 97be12cf4cf4e0d763cbc8c50c42b39b8510948ce74d7cd2cfa93fa63f8f0b5af6f9340f9c402f08e528c5ec0d26ddfff08fb014d477350f29246b237b889da7
DIST phc-intel-0.3.2.10.tar.bz2 20680 SHA256 8483e071ad2644c339539ac5298c7a31a12212fd9a68baa1f6766dad146510f5
DIST phc-intel-0.3.2.12.1.tar.bz2 14412 SHA256 4f66989d424d328b205873da1b0363e75f27d7912e0e93c1cad3407c17be8264 SHA512 f9a63300fe1d7b42d1167c3b6d1f5b75cb707d8dac26d2d91f40466a26afedf3dccb76a58bb4764233ade6c309cdd554f869cdaeac04bf521607644afb709427 WHIRLPOOL dd064a2f5a67fc2aed96aa32bce4e040daf8468d2a215dbb08e11b00de039e7ac6179ea756a94035478a885a202f13517ec45a8dd8dfcd072436a0c8509e2fd0
-EBUILD phc-intel-0.3.199.3_pre.ebuild 1201 SHA256 cf022fadc97cd3b56ed3888b9f645d8943447a741627b2d80e19cb315147a1c0 SHA512 347b15195443ae14743eb44991a692bcc19ab50ddac83db769a7afcbc022330f0fd438a689797b3ff2da76a0297c6bb1f62ba3b4a4b772f6c56b96f3526462b7 WHIRLPOOL 976ecb939a0cd05922e6a6eb70854d5d9246ad9a6dd2ef45baf693fad40f6b27cab3273494b03a7badf34f1452b14283967210c5f97d3834e05220d7a6c4af4c
+DIST phc-intel-pack-rev11.tar.bz2 76485 SHA256 38f4bd923228ef61315a0739f32504692d7f1809494bdc369658222f6f873479 SHA512 2bb718cc78219db8698f671ecfcc895cfd5be66d7301c56e91d24a534d308121a8a76cbd1259022e8e524b359eee34b7965da952254b26f9cb6a0bd81ff88981 WHIRLPOOL 8d40a2f4319764f15b413621ff30d39b1667281fe08a570b18e32f53197b421c85c0f0a62b99e52c9ccdac887cbcf41366790aab1b86eb79f12799455185d481
+EBUILD phc-intel-0.3.199.11_pre.ebuild 1760 SHA256 0ea5e7c21d86914947a2da78c44bc1c06b6cf363b1fd4bee346ae9a19342e162 SHA512 ae13812ebc280a8e058c272ad31d7198ff27fbd4f24c069adf9395cc971775acbc95d66a23fa2f952daaff49236ff22e858598aea784aa4ec6cf5dd4e8b7528e WHIRLPOOL d082128975a36dfe94c0fb0b6d73a8bf7e495ca6e7e3f30c5a9d813ab62602b2c89e61cc6ff42c59db6ca1e516f30408d538bdedca33ebb9dfd062528ac5cf7e
EBUILD phc-intel-0.3.2.10.ebuild 1079 SHA256 19ed93eab1feeb9cd3aa214ba76ff5834cff06cb821676842574e6075f8a92c4 SHA512 038fa33588b9c2c57184f6978b36315841697d2b8fc91d4307336408623813d04bbef9fe17a940ef627b84bbcfb008111b823a11243af83b90c6928756b98551 WHIRLPOOL 670fd1c97f6dab85e7814b36c4b1d4b0f90ac6db0bba01d943f2d9d7b680f8e38aef84e5b6aa9d037f71d29b7cac955fd2d953815e7fdda4fe7ce96fd4488166
-EBUILD phc-intel-0.3.2.12.1-r3.ebuild 1696 SHA256 e1b3824ce44d78d60a9a906e10c4a4ddc28c9d0c4e2cdaf8afe536e956944fe0 SHA512 3b58991a343c10708baccf956104047ec24f343e053354f67dd7d861b5d5f70dd9f7a19f7ea62a0fd24ec4789dfbf9983fe923545b20f1c2d36755773a2e7121 WHIRLPOOL 504069347de21a785b4b3ed91b16c3854c3d01086898483a19cbf3189136dc191abf10cc4c75ea7755e1233d7bd70273c7880f8ae7d849a95a09d83073c6b8d0
-EBUILD phc-intel-0.3.2.12.1-r4.ebuild 1761 SHA256 236bc265725594d810184dbc2c313892a63d42b34e583b43bd9812f18521c6c1 SHA512 366adc050ff471faa0ba0c00d9419a8f0b8e0bf17b1155eddbd94a14f6c53afd9e4f22c50604fbb182790805f45bec2c1714df40d53e7506f4672fa57992b452 WHIRLPOOL b3478783a558b4c8f2edd5c21899165ba3f037e45f98a3af9ea07283d58396efc3f6be7ddc72d068707eb5db570cf41803df1c210576d608550607da27f6e8c8
-EBUILD phc-intel-0.3.2.12.1-r5.ebuild 1764 SHA256 f4907f4c2ed756f5a38fc1f7a66af61d22e229480c8e33672b59a625be417c69 SHA512 0153c78299fb73d3edcf1b968ea1e689e38ad414b2c36ba31c572b02268ffba3c5fad13dc51801e4641129d8eabeb465e5e87a0c47fb4358d4da05967b3ef540 WHIRLPOOL 3a6cb7ec843c671cba758f8772f68fdb26974522102ebba23f45ca3659c5fd75babdd6084ce4133de38773dff5cd0a1a18079afb4b54d904b7a5cbe63f57cecf
-MISC ChangeLog 2455 SHA256 6ba5bade93f52c1c92d3c2131a028f8a45b923bb3e54b288bf1bfa04a422aa09 SHA512 e81847f4200355d0d194f9043f3df6dca775f5ebbce30db2a89f240c3c4fcc2e4ede7ef2f3eacd87d71627c5c9cd8a366cf0e907fa431a1585f941b4523307da WHIRLPOOL 33fc6d3d9555d44650cb210fce9b3782a3ad9cbbec0aea277404e7410e0e4a3e0177f4ab9853b0e914e92b0e12c6cc732cca3a0ce1d425250f8443116fb55c8e
+EBUILD phc-intel-0.3.2.12.1-r5.ebuild 1943 SHA256 10f761f6fc644b782f6249accfb06c2c48ceac0fe4ff2ab51c882ce16cb756aa SHA512 f2219d28b581042078689e4a5f853087f5deadf7215bd82eced4b631950a139b3eb0ab0cd09419e27c5bc3ecd8e7b4bea2598fa860852bca1d59962ec55b8363 WHIRLPOOL 321eb7e007171991c8df80a2fabc8f0480de646d9fa1266eb7900a122400d9816558b565bb002ffe88836e4ef8e9f74b6cf83d0c3611431c7ae6631087ab639b
+EBUILD phc-intel-0.3.2.12.11.ebuild 1830 SHA256 aa9b54dde61b2f0b08ed97c217c5f191f4e52cd0de1967c6a2bf9eaa5fb8760f SHA512 f8e8d93b206e94af135b91b5f5bf8118fae87d4c2e5216c139ac9163683aafeb57e1aacc86baa0fdda5ef6b696507ad9a1bb8e700e4ffdf3560a8f32bfadda9e WHIRLPOOL df9723c9431326f533bc1b877decc9ace1a0a7c2816496a4c3fca57cddde67bb687e89f14b07b04a0992d235c2a9d1cb70748dc3c7a11fc00dd4528140c69a81
+MISC ChangeLog 3194 SHA256 1eda3272dc782ac57b7f0b3e2128e3a963600b939319195a5a4c1882091c133d SHA512 fdba78c77f1fede39588f1787a5c64ee6e2ac7c467daed3b513db3fe949480956c2be048e64b7a5140a6d36f5f227f6a452640e8dcac1143cfe80229e6362076 WHIRLPOOL 7d47df75741456b748aeddf98e32b6cd038b6e841e2ff41e7d7ffbee496814512a09e483b6da10cc6f5215b716adb63e5c70c3734a41460a2d5de1aca39f7b9c
MISC metadata.xml 223 SHA256 89097f936927d56068988263e382edb683f359b27293955708e9ade4d256220d SHA512 c9f6a48b2aa05afdf73b8bd824c65480d76e54b659ca39928398c66f764d34faf186255d8aea034737424a962cf35151b610d078a01f8193b027c63e1e3c51b5 WHIRLPOOL 1ce20c98a7e177b8f510ef41f3935b0db5e04b2ecf465a683b2f2515f6a3043c33e6e9efc87f5aaaf59b2ed9be376d9d16bc8beff66b11aaa50ea899bfdc1f62
-----BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.19 (GNU/Linux)
+Version: GnuPG v2.0.20 (GNU/Linux)
-iF4EAREIAAYFAlDOx6YACgkQknrdDGLu8JDdaQEAgDGlVM0mv98wOnB6D8hx0fxm
-sjPzQeGK0hdmaSio3tsA/RH56hTVEp8VPZLIaaN/82Oohrj4ibs4yu6d//vHHxJ+
-=ftvT
+iF4EAREIAAYFAlIogmYACgkQknrdDGLu8JBgvQD9F+LjHxcJ+E+s+c7ty8VfMiQ7
+6eFNA//FoUhLQF5XLkcA/iR4a7SYKBWt751QLpDta0rzqOJBbiDU05z31ZLTYk79
+=cYy9
-----END PGP SIGNATURE-----
diff --git a/sys-power/phc-intel/files/phc-intel-0.3.2.12.1-2.6.35.patch b/sys-power/phc-intel/files/phc-intel-0.3.2.12.1-2.6.35.patch
deleted file mode 100644
index c456887a541c..000000000000
--- a/sys-power/phc-intel/files/phc-intel-0.3.2.12.1-2.6.35.patch
+++ /dev/null
@@ -1,529 +0,0 @@
---- /tmp/acpi-cpufreq.c.orig 2010-08-07 09:25:45.510440771 +0200
-+++ phc-intel-0.3.2-12-1/phc-intel.c
-@@ -25,6 +25,10 @@
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- */
-
-+/* This file has been patched with Linux PHC: www.linux-phc.org
-+* Patch version: linux-phc-0.3.2
-+*/
-+
- #include <linux/kernel.h>
- #include <linux/module.h>
- #include <linux/init.h>
-@@ -62,12 +66,17 @@
- };
-
- #define INTEL_MSR_RANGE (0xffff)
-+#define INTEL_MSR_VID_MASK (0x00ff)
-+#define INTEL_MSR_FID_MASK (0xff00)
-+#define INTEL_MSR_FID_SHIFT (0x8)
-+#define PHC_VERSION_STRING "0.3.2:2"
-
- struct acpi_cpufreq_data {
- struct acpi_processor_performance *acpi_data;
- struct cpufreq_frequency_table *freq_table;
- unsigned int resume;
- unsigned int cpu_feature;
-+ acpi_integer *original_controls;
- };
-
- static DEFINE_PER_CPU(struct acpi_cpufreq_data *, acfreq_data);
-@@ -103,13 +112,14 @@
- static unsigned extract_msr(u32 msr, struct acpi_cpufreq_data *data)
- {
- int i;
-+ u32 fid;
- struct acpi_processor_performance *perf;
-
-- msr &= INTEL_MSR_RANGE;
-+ fid = msr & INTEL_MSR_FID_MASK;
- perf = data->acpi_data;
-
- for (i = 0; data->freq_table[i].frequency != CPUFREQ_TABLE_END; i++) {
-- if (msr == perf->states[data->freq_table[i].index].status)
-+ if (fid == (perf->states[data->freq_table[i].index].status & INTEL_MSR_FID_MASK))
- return data->freq_table[i].frequency;
- }
- return data->freq_table[0].frequency;
-@@ -704,6 +714,8 @@
- per_cpu(acfreq_data, policy->cpu) = NULL;
- acpi_processor_unregister_performance(data->acpi_data,
- policy->cpu);
-+ if (data->original_controls)
-+ kfree(data->original_controls);
- kfree(data);
- }
-
-@@ -721,8 +733,470 @@
- return 0;
- }
-
-+
-+/* sysfs interface to change operating points voltages */
-+
-+static unsigned int extract_fid_from_control(unsigned int control)
-+{
-+ return ((control & INTEL_MSR_FID_MASK) >> INTEL_MSR_FID_SHIFT);
-+}
-+
-+static unsigned int extract_vid_from_control(unsigned int control)
-+{
-+ return (control & INTEL_MSR_VID_MASK);
-+}
-+
-+
-+static bool check_cpu_control_capability(struct acpi_cpufreq_data *data) {
-+ /* check if the cpu we are running on is capable of setting new control data
-+ *
-+ */
-+ if (unlikely(data == NULL ||
-+ data->acpi_data == NULL ||
-+ data->freq_table == NULL ||
-+ data->cpu_feature != SYSTEM_INTEL_MSR_CAPABLE)) {
-+ return false;
-+ } else {
-+ return true;
-+ };
-+}
-+
-+
-+static ssize_t check_origial_table (struct acpi_cpufreq_data *data)
-+{
-+
-+ struct acpi_processor_performance *acpi_data;
-+ struct cpufreq_frequency_table *freq_table;
-+ unsigned int state_index;
-+
-+ acpi_data = data->acpi_data;
-+ freq_table = data->freq_table;
-+
-+ if (data->original_controls == NULL) {
-+ // Backup original control values
-+ data->original_controls = kcalloc(acpi_data->state_count,
-+ sizeof(acpi_integer), GFP_KERNEL);
-+ if (data->original_controls == NULL) {
-+ printk("failed to allocate memory for original control values\n");
-+ return -ENOMEM;
-+ }
-+ for (state_index = 0; state_index < acpi_data->state_count; state_index++) {
-+ data->original_controls[state_index] = acpi_data->states[state_index].control;
-+ }
-+ }
-+ return 0;
-+}
-+
-+static ssize_t show_freq_attr_vids(struct cpufreq_policy *policy, char *buf)
-+ /* display phc's voltage id's
-+ *
-+ */
-+{
-+ struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu);
-+ struct acpi_processor_performance *acpi_data;
-+ struct cpufreq_frequency_table *freq_table;
-+ unsigned int i;
-+ unsigned int vid;
-+ ssize_t count = 0;
-+
-+ if (!check_cpu_control_capability(data)) return -ENODEV; //check if CPU is capable of changing controls
-+
-+ acpi_data = data->acpi_data;
-+ freq_table = data->freq_table;
-+
-+ for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++) {
-+ vid = extract_vid_from_control(acpi_data->states[freq_table[i].index].control);
-+ count += sprintf(&buf[count], "%u ", vid);
-+ }
-+ count += sprintf(&buf[count], "\n");
-+
-+ return count;
-+}
-+
-+static ssize_t show_freq_attr_default_vids(struct cpufreq_policy *policy, char *buf)
-+ /* display acpi's default voltage id's
-+ *
-+ */
-+{
-+ struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu);
-+ struct cpufreq_frequency_table *freq_table;
-+ unsigned int i;
-+ unsigned int vid;
-+ ssize_t count = 0;
-+ ssize_t retval;
-+
-+ if (!check_cpu_control_capability(data)) return -ENODEV; //check if CPU is capable of changing controls
-+
-+ retval = check_origial_table(data);
-+ if (0 != retval)
-+ return retval;
-+
-+ freq_table = data->freq_table;
-+
-+ for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++) {
-+ vid = extract_vid_from_control(data->original_controls[freq_table[i].index]);
-+ count += sprintf(&buf[count], "%u ", vid);
-+ }
-+ count += sprintf(&buf[count], "\n");
-+
-+ return count;
-+}
-+
-+static ssize_t show_freq_attr_fids(struct cpufreq_policy *policy, char *buf)
-+ /* display phc's frequeny id's
-+ *
-+ */
-+{
-+ struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu);
-+ struct acpi_processor_performance *acpi_data;
-+ struct cpufreq_frequency_table *freq_table;
-+ unsigned int i;
-+ unsigned int fid;
-+ ssize_t count = 0;
-+
-+ if (!check_cpu_control_capability(data)) return -ENODEV; //check if CPU is capable of changing controls
-+
-+ acpi_data = data->acpi_data;
-+ freq_table = data->freq_table;
-+
-+ for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++) {
-+ fid = extract_fid_from_control(acpi_data->states[freq_table[i].index].control);
-+ count += sprintf(&buf[count], "%u ", fid);
-+ }
-+ count += sprintf(&buf[count], "\n");
-+
-+ return count;
-+}
-+
-+static ssize_t show_freq_attr_controls(struct cpufreq_policy *policy, char *buf)
-+ /* display phc's controls for the cpu (frequency id's and related voltage id's)
-+ *
-+ */
-+{
-+ struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu);
-+ struct acpi_processor_performance *acpi_data;
-+ struct cpufreq_frequency_table *freq_table;
-+ unsigned int i;
-+ unsigned int fid;
-+ unsigned int vid;
-+ ssize_t count = 0;
-+
-+ if (!check_cpu_control_capability(data)) return -ENODEV; //check if CPU is capable of changing controls
-+
-+ acpi_data = data->acpi_data;
-+ freq_table = data->freq_table;
-+
-+ for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++) {
-+ fid = extract_fid_from_control(acpi_data->states[freq_table[i].index].control);
-+ vid = extract_vid_from_control(acpi_data->states[freq_table[i].index].control);
-+ count += sprintf(&buf[count], "%u:%u ", fid, vid);
-+ }
-+ count += sprintf(&buf[count], "\n");
-+
-+ return count;
-+}
-+
-+static ssize_t show_freq_attr_default_controls(struct cpufreq_policy *policy, char *buf)
-+ /* display acpi's default controls for the cpu (frequency id's and related voltage id's)
-+ *
-+ */
-+{
-+ struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu);
-+ struct cpufreq_frequency_table *freq_table;
-+ unsigned int i;
-+ unsigned int fid;
-+ unsigned int vid;
-+ ssize_t count = 0;
-+ ssize_t retval;
-+
-+ if (!check_cpu_control_capability(data)) return -ENODEV; //check if CPU is capable of changing controls
-+
-+ retval = check_origial_table(data);
-+ if (0 != retval)
-+ return retval;
-+
-+ freq_table = data->freq_table;
-+
-+ for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++) {
-+ fid = extract_fid_from_control(data->original_controls[freq_table[i].index]);
-+ vid = extract_vid_from_control(data->original_controls[freq_table[i].index]);
-+ count += sprintf(&buf[count], "%u:%u ", fid, vid);
-+ }
-+ count += sprintf(&buf[count], "\n");
-+
-+ return count;
-+}
-+
-+
-+static ssize_t store_freq_attr_vids(struct cpufreq_policy *policy, const char *buf, size_t count)
-+ /* store the voltage id's for the related frequency
-+ * We are going to do some sanity checks here to prevent users
-+ * from setting higher voltages than the default one.
-+ */
-+{
-+ struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu);
-+ struct acpi_processor_performance *acpi_data;
-+ struct cpufreq_frequency_table *freq_table;
-+ unsigned int freq_index;
-+ unsigned int state_index;
-+ unsigned int new_vid;
-+ unsigned int original_vid;
-+ unsigned int new_control;
-+ unsigned int original_control;
-+ const char *curr_buf = buf;
-+ char *next_buf;
-+ ssize_t retval;
-+
-+ if (!check_cpu_control_capability(data)) return -ENODEV; //check if CPU is capable of changing controls
-+
-+ retval = check_origial_table(data);
-+ if (0 != retval)
-+ return retval;
-+
-+ acpi_data = data->acpi_data;
-+ freq_table = data->freq_table;
-+
-+ /* for each value taken from the sysfs interfalce (phc_vids) get entrys and convert them to unsigned long integers*/
-+ for (freq_index = 0; freq_table[freq_index].frequency != CPUFREQ_TABLE_END; freq_index++) {
-+ new_vid = simple_strtoul(curr_buf, &next_buf, 10);
-+ if (next_buf == curr_buf) {
-+ if ((curr_buf - buf == count - 1) && (*curr_buf == '\n')) { //end of line?
-+ curr_buf++;
-+ break;
-+ }
-+ //if we didn't got end of line but there is nothing more to read something went wrong...
-+ printk("failed to parse vid value at %i (%s)\n", freq_index, curr_buf);
-+ return -EINVAL;
-+ }
-+
-+ state_index = freq_table[freq_index].index;
-+ original_control = data->original_controls[state_index];
-+ original_vid = original_control & INTEL_MSR_VID_MASK;
-+
-+ /* before we store the values we do some checks to prevent
-+ * users to set up values higher than the default one
-+ */
-+ if (new_vid <= original_vid) {
-+ new_control = (original_control & ~INTEL_MSR_VID_MASK) | new_vid;
-+ dprintk("setting control at %i to %x (default is %x)\n",
-+ freq_index, new_control, original_control);
-+ acpi_data->states[state_index].control = new_control;
-+
-+ } else {
-+ printk("skipping vid at %i, %u is greater than default %u\n",
-+ freq_index, new_vid, original_vid);
-+ }
-+
-+ curr_buf = next_buf;
-+ /* jump over value seperators (space or comma).
-+ * There could be more than one space or comma character
-+ * to separate two values so we better do it using a loop.
-+ */
-+ while ((curr_buf - buf < count) && ((*curr_buf == ' ') || (*curr_buf == ','))) {
-+ curr_buf++;
-+ }
-+ }
-+
-+ /* set new voltage for current frequency */
-+ data->resume = 1;
-+ acpi_cpufreq_target(policy, get_cur_freq_on_cpu(policy->cpu), CPUFREQ_RELATION_L);
-+
-+ return curr_buf - buf;
-+}
-+
-+static ssize_t store_freq_attr_controls(struct cpufreq_policy *policy, const char *buf, size_t count)
-+ /* store the controls (frequency id's and related voltage id's)
-+ * We are going to do some sanity checks here to prevent users
-+ * from setting higher voltages than the default one.
-+ */
-+{
-+ struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu);
-+ struct acpi_processor_performance *acpi_data;
-+ struct cpufreq_frequency_table *freq_table;
-+ const char *curr_buf;
-+ unsigned int op_count;
-+ unsigned int state_index;
-+ int isok;
-+ char *next_buf;
-+ ssize_t retval;
-+ unsigned int new_vid;
-+ unsigned int original_vid;
-+ unsigned int new_fid;
-+ unsigned int old_fid;
-+ unsigned int original_control;
-+ unsigned int old_control;
-+ unsigned int new_control;
-+ int found;
-+
-+ if (!check_cpu_control_capability(data)) return -ENODEV;
-+
-+ retval = check_origial_table(data);
-+ if (0 != retval)
-+ return retval;
-+
-+ acpi_data = data->acpi_data;
-+ freq_table = data->freq_table;
-+
-+ op_count = 0;
-+ curr_buf = buf;
-+ next_buf = NULL;
-+ isok = 1;
-+
-+ while ( (isok) && (curr_buf != NULL) )
-+ {
-+ op_count++;
-+ // Parse fid
-+ new_fid = simple_strtoul(curr_buf, &next_buf, 10);
-+ if ((next_buf != curr_buf) && (next_buf != NULL))
-+ {
-+ // Parse separator between frequency and voltage
-+ curr_buf = next_buf;
-+ next_buf = NULL;
-+ if (*curr_buf==':')
-+ {
-+ curr_buf++;
-+ // Parse vid
-+ new_vid = simple_strtoul(curr_buf, &next_buf, 10);
-+ if ((next_buf != curr_buf) && (next_buf != NULL))
-+ {
-+ found = 0;
-+ for (state_index = 0; state_index < acpi_data->state_count; state_index++) {
-+ old_control = acpi_data->states[state_index].control;
-+ old_fid = extract_fid_from_control(old_control);
-+ if (new_fid == old_fid)
-+ {
-+ found = 1;
-+ original_control = data->original_controls[state_index];
-+ original_vid = extract_vid_from_control(original_control);
-+ if (new_vid <= original_vid)
-+ {
-+ new_control = (original_control & ~INTEL_MSR_VID_MASK) | new_vid;
-+ dprintk("setting control at %i to %x (default is %x)\n",
-+ state_index, new_control, original_control);
-+ acpi_data->states[state_index].control = new_control;
-+
-+ } else {
-+ printk("skipping vid at %i, %u is greater than default %u\n",
-+ state_index, new_vid, original_vid);
-+ }
-+ }
-+ }
-+
-+ if (found == 0)
-+ {
-+ printk("operating point # %u not found (FID = %u)\n", op_count, new_fid);
-+ isok = 0;
-+ }
-+
-+ // Parse seprator before next operating point, if any
-+ curr_buf = next_buf;
-+ next_buf = NULL;
-+ if ((*curr_buf == ',') || (*curr_buf == ' '))
-+ curr_buf++;
-+ else
-+ curr_buf = NULL;
-+ }
-+ else
-+ {
-+ printk("failed to parse VID of operating point # %u (%s)\n", op_count, curr_buf);
-+ isok = 0;
-+ }
-+ }
-+ else
-+ {
-+ printk("failed to parse operating point # %u (%s)\n", op_count, curr_buf);
-+ isok = 0;
-+ }
-+ }
-+ else
-+ {
-+ printk("failed to parse FID of operating point # %u (%s)\n", op_count, curr_buf);
-+ isok = 0;
-+ }
-+ }
-+
-+ if (isok)
-+ {
-+ retval = count;
-+ /* set new voltage at current frequency */
-+ data->resume = 1;
-+ acpi_cpufreq_target(policy, get_cur_freq_on_cpu(policy->cpu), CPUFREQ_RELATION_L);
-+ }
-+ else
-+ {
-+ retval = -EINVAL;
-+ }
-+
-+ return retval;
-+}
-+
-+static ssize_t show_freq_attr_phc_version(struct cpufreq_policy *policy, char *buf)
-+ /* print out the phc version string set at the beginning of that file
-+ */
-+{
-+ ssize_t count = 0;
-+ count += sprintf(&buf[count], "%s\n", PHC_VERSION_STRING);
-+ return count;
-+}
-+
-+
-+
-+static struct freq_attr cpufreq_freq_attr_phc_version =
-+{
-+ /*display phc's version string*/
-+ .attr = { .name = "phc_version", .mode = 0444, .owner = THIS_MODULE },
-+ .show = show_freq_attr_phc_version,
-+ .store = NULL,
-+};
-+
-+static struct freq_attr cpufreq_freq_attr_vids =
-+{
-+ /*display phc's voltage id's for the cpu*/
-+ .attr = { .name = "phc_vids", .mode = 0644, .owner = THIS_MODULE },
-+ .show = show_freq_attr_vids,
-+ .store = store_freq_attr_vids,
-+};
-+
-+static struct freq_attr cpufreq_freq_attr_default_vids =
-+{
-+ /*display acpi's default frequency id's for the cpu*/
-+ .attr = { .name = "phc_default_vids", .mode = 0444, .owner = THIS_MODULE },
-+ .show = show_freq_attr_default_vids,
-+ .store = NULL,
-+};
-+
-+static struct freq_attr cpufreq_freq_attr_fids =
-+{
-+ /*display phc's default frequency id's for the cpu*/
-+ .attr = { .name = "phc_fids", .mode = 0444, .owner = THIS_MODULE },
-+ .show = show_freq_attr_fids,
-+ .store = NULL,
-+};
-+
-+static struct freq_attr cpufreq_freq_attr_controls =
-+{
-+ /*display phc's current voltage/frequency controls for the cpu*/
-+ .attr = { .name = "phc_controls", .mode = 0644, .owner = THIS_MODULE },
-+ .show = show_freq_attr_controls,
-+ .store = store_freq_attr_controls,
-+};
-+
-+static struct freq_attr cpufreq_freq_attr_default_controls =
-+{
-+ /*display acpi's default voltage/frequency controls for the cpu*/
-+ .attr = { .name = "phc_default_controls", .mode = 0444, .owner = THIS_MODULE },
-+ .show = show_freq_attr_default_controls,
-+ .store = NULL,
-+};
-+
- static struct freq_attr *acpi_cpufreq_attr[] = {
-- &cpufreq_freq_attr_scaling_available_freqs,
-+ &cpufreq_freq_attr_scaling_available_freqs,
-+ &cpufreq_freq_attr_phc_version,
-+ &cpufreq_freq_attr_vids,
-+ &cpufreq_freq_attr_default_vids,
-+ &cpufreq_freq_attr_fids,
-+ &cpufreq_freq_attr_controls,
-+ &cpufreq_freq_attr_default_controls,
- NULL,
- };
-
diff --git a/sys-power/phc-intel/files/phc-intel-0.3.2.12.1-2.6.36.patch b/sys-power/phc-intel/files/phc-intel-0.3.2.12.1-2.6.36.patch
deleted file mode 100644
index 80d3b239d04a..000000000000
--- a/sys-power/phc-intel/files/phc-intel-0.3.2.12.1-2.6.36.patch
+++ /dev/null
@@ -1,529 +0,0 @@
---- /tmp/acpi-cpufreq.c.orig 2010-08-07 09:25:45.510440771 +0200
-+++ phc-intel-0.3.2-12-1/phc-intel.c
-@@ -25,6 +25,10 @@
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- */
-
-+/* This file has been patched with Linux PHC: www.linux-phc.org
-+* Patch version: linux-phc-0.3.2
-+*/
-+
- #include <linux/kernel.h>
- #include <linux/module.h>
- #include <linux/init.h>
-@@ -62,12 +66,17 @@
- };
-
- #define INTEL_MSR_RANGE (0xffff)
-+#define INTEL_MSR_VID_MASK (0x00ff)
-+#define INTEL_MSR_FID_MASK (0xff00)
-+#define INTEL_MSR_FID_SHIFT (0x8)
-+#define PHC_VERSION_STRING "0.3.2:2"
-
- struct acpi_cpufreq_data {
- struct acpi_processor_performance *acpi_data;
- struct cpufreq_frequency_table *freq_table;
- unsigned int resume;
- unsigned int cpu_feature;
-+ acpi_integer *original_controls;
- };
-
- static DEFINE_PER_CPU(struct acpi_cpufreq_data *, acfreq_data);
-@@ -103,13 +112,14 @@
- static unsigned extract_msr(u32 msr, struct acpi_cpufreq_data *data)
- {
- int i;
-+ u32 fid;
- struct acpi_processor_performance *perf;
-
-- msr &= INTEL_MSR_RANGE;
-+ fid = msr & INTEL_MSR_FID_MASK;
- perf = data->acpi_data;
-
- for (i = 0; data->freq_table[i].frequency != CPUFREQ_TABLE_END; i++) {
-- if (msr == perf->states[data->freq_table[i].index].status)
-+ if (fid == (perf->states[data->freq_table[i].index].status & INTEL_MSR_FID_MASK))
- return data->freq_table[i].frequency;
- }
- return data->freq_table[0].frequency;
-@@ -704,6 +714,8 @@
- per_cpu(acfreq_data, policy->cpu) = NULL;
- acpi_processor_unregister_performance(data->acpi_data,
- policy->cpu);
-+ if (data->original_controls)
-+ kfree(data->original_controls);
- kfree(data);
- }
-
-@@ -721,8 +733,470 @@
- return 0;
- }
-
-+
-+/* sysfs interface to change operating points voltages */
-+
-+static unsigned int extract_fid_from_control(unsigned int control)
-+{
-+ return ((control & INTEL_MSR_FID_MASK) >> INTEL_MSR_FID_SHIFT);
-+}
-+
-+static unsigned int extract_vid_from_control(unsigned int control)
-+{
-+ return (control & INTEL_MSR_VID_MASK);
-+}
-+
-+
-+static bool check_cpu_control_capability(struct acpi_cpufreq_data *data) {
-+ /* check if the cpu we are running on is capable of setting new control data
-+ *
-+ */
-+ if (unlikely(data == NULL ||
-+ data->acpi_data == NULL ||
-+ data->freq_table == NULL ||
-+ data->cpu_feature != SYSTEM_INTEL_MSR_CAPABLE)) {
-+ return false;
-+ } else {
-+ return true;
-+ };
-+}
-+
-+
-+static ssize_t check_origial_table (struct acpi_cpufreq_data *data)
-+{
-+
-+ struct acpi_processor_performance *acpi_data;
-+ struct cpufreq_frequency_table *freq_table;
-+ unsigned int state_index;
-+
-+ acpi_data = data->acpi_data;
-+ freq_table = data->freq_table;
-+
-+ if (data->original_controls == NULL) {
-+ // Backup original control values
-+ data->original_controls = kcalloc(acpi_data->state_count,
-+ sizeof(acpi_integer), GFP_KERNEL);
-+ if (data->original_controls == NULL) {
-+ printk("failed to allocate memory for original control values\n");
-+ return -ENOMEM;
-+ }
-+ for (state_index = 0; state_index < acpi_data->state_count; state_index++) {
-+ data->original_controls[state_index] = acpi_data->states[state_index].control;
-+ }
-+ }
-+ return 0;
-+}
-+
-+static ssize_t show_freq_attr_vids(struct cpufreq_policy *policy, char *buf)
-+ /* display phc's voltage id's
-+ *
-+ */
-+{
-+ struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu);
-+ struct acpi_processor_performance *acpi_data;
-+ struct cpufreq_frequency_table *freq_table;
-+ unsigned int i;
-+ unsigned int vid;
-+ ssize_t count = 0;
-+
-+ if (!check_cpu_control_capability(data)) return -ENODEV; //check if CPU is capable of changing controls
-+
-+ acpi_data = data->acpi_data;
-+ freq_table = data->freq_table;
-+
-+ for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++) {
-+ vid = extract_vid_from_control(acpi_data->states[freq_table[i].index].control);
-+ count += sprintf(&buf[count], "%u ", vid);
-+ }
-+ count += sprintf(&buf[count], "\n");
-+
-+ return count;
-+}
-+
-+static ssize_t show_freq_attr_default_vids(struct cpufreq_policy *policy, char *buf)
-+ /* display acpi's default voltage id's
-+ *
-+ */
-+{
-+ struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu);
-+ struct cpufreq_frequency_table *freq_table;
-+ unsigned int i;
-+ unsigned int vid;
-+ ssize_t count = 0;
-+ ssize_t retval;
-+
-+ if (!check_cpu_control_capability(data)) return -ENODEV; //check if CPU is capable of changing controls
-+
-+ retval = check_origial_table(data);
-+ if (0 != retval)
-+ return retval;
-+
-+ freq_table = data->freq_table;
-+
-+ for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++) {
-+ vid = extract_vid_from_control(data->original_controls[freq_table[i].index]);
-+ count += sprintf(&buf[count], "%u ", vid);
-+ }
-+ count += sprintf(&buf[count], "\n");
-+
-+ return count;
-+}
-+
-+static ssize_t show_freq_attr_fids(struct cpufreq_policy *policy, char *buf)
-+ /* display phc's frequeny id's
-+ *
-+ */
-+{
-+ struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu);
-+ struct acpi_processor_performance *acpi_data;
-+ struct cpufreq_frequency_table *freq_table;
-+ unsigned int i;
-+ unsigned int fid;
-+ ssize_t count = 0;
-+
-+ if (!check_cpu_control_capability(data)) return -ENODEV; //check if CPU is capable of changing controls
-+
-+ acpi_data = data->acpi_data;
-+ freq_table = data->freq_table;
-+
-+ for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++) {
-+ fid = extract_fid_from_control(acpi_data->states[freq_table[i].index].control);
-+ count += sprintf(&buf[count], "%u ", fid);
-+ }
-+ count += sprintf(&buf[count], "\n");
-+
-+ return count;
-+}
-+
-+static ssize_t show_freq_attr_controls(struct cpufreq_policy *policy, char *buf)
-+ /* display phc's controls for the cpu (frequency id's and related voltage id's)
-+ *
-+ */
-+{
-+ struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu);
-+ struct acpi_processor_performance *acpi_data;
-+ struct cpufreq_frequency_table *freq_table;
-+ unsigned int i;
-+ unsigned int fid;
-+ unsigned int vid;
-+ ssize_t count = 0;
-+
-+ if (!check_cpu_control_capability(data)) return -ENODEV; //check if CPU is capable of changing controls
-+
-+ acpi_data = data->acpi_data;
-+ freq_table = data->freq_table;
-+
-+ for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++) {
-+ fid = extract_fid_from_control(acpi_data->states[freq_table[i].index].control);
-+ vid = extract_vid_from_control(acpi_data->states[freq_table[i].index].control);
-+ count += sprintf(&buf[count], "%u:%u ", fid, vid);
-+ }
-+ count += sprintf(&buf[count], "\n");
-+
-+ return count;
-+}
-+
-+static ssize_t show_freq_attr_default_controls(struct cpufreq_policy *policy, char *buf)
-+ /* display acpi's default controls for the cpu (frequency id's and related voltage id's)
-+ *
-+ */
-+{
-+ struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu);
-+ struct cpufreq_frequency_table *freq_table;
-+ unsigned int i;
-+ unsigned int fid;
-+ unsigned int vid;
-+ ssize_t count = 0;
-+ ssize_t retval;
-+
-+ if (!check_cpu_control_capability(data)) return -ENODEV; //check if CPU is capable of changing controls
-+
-+ retval = check_origial_table(data);
-+ if (0 != retval)
-+ return retval;
-+
-+ freq_table = data->freq_table;
-+
-+ for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++) {
-+ fid = extract_fid_from_control(data->original_controls[freq_table[i].index]);
-+ vid = extract_vid_from_control(data->original_controls[freq_table[i].index]);
-+ count += sprintf(&buf[count], "%u:%u ", fid, vid);
-+ }
-+ count += sprintf(&buf[count], "\n");
-+
-+ return count;
-+}
-+
-+
-+static ssize_t store_freq_attr_vids(struct cpufreq_policy *policy, const char *buf, size_t count)
-+ /* store the voltage id's for the related frequency
-+ * We are going to do some sanity checks here to prevent users
-+ * from setting higher voltages than the default one.
-+ */
-+{
-+ struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu);
-+ struct acpi_processor_performance *acpi_data;
-+ struct cpufreq_frequency_table *freq_table;
-+ unsigned int freq_index;
-+ unsigned int state_index;
-+ unsigned int new_vid;
-+ unsigned int original_vid;
-+ unsigned int new_control;
-+ unsigned int original_control;
-+ const char *curr_buf = buf;
-+ char *next_buf;
-+ ssize_t retval;
-+
-+ if (!check_cpu_control_capability(data)) return -ENODEV; //check if CPU is capable of changing controls
-+
-+ retval = check_origial_table(data);
-+ if (0 != retval)
-+ return retval;
-+
-+ acpi_data = data->acpi_data;
-+ freq_table = data->freq_table;
-+
-+ /* for each value taken from the sysfs interfalce (phc_vids) get entrys and convert them to unsigned long integers*/
-+ for (freq_index = 0; freq_table[freq_index].frequency != CPUFREQ_TABLE_END; freq_index++) {
-+ new_vid = simple_strtoul(curr_buf, &next_buf, 10);
-+ if (next_buf == curr_buf) {
-+ if ((curr_buf - buf == count - 1) && (*curr_buf == '\n')) { //end of line?
-+ curr_buf++;
-+ break;
-+ }
-+ //if we didn't got end of line but there is nothing more to read something went wrong...
-+ printk("failed to parse vid value at %i (%s)\n", freq_index, curr_buf);
-+ return -EINVAL;
-+ }
-+
-+ state_index = freq_table[freq_index].index;
-+ original_control = data->original_controls[state_index];
-+ original_vid = original_control & INTEL_MSR_VID_MASK;
-+
-+ /* before we store the values we do some checks to prevent
-+ * users to set up values higher than the default one
-+ */
-+ if (new_vid <= original_vid) {
-+ new_control = (original_control & ~INTEL_MSR_VID_MASK) | new_vid;
-+ dprintk("setting control at %i to %x (default is %x)\n",
-+ freq_index, new_control, original_control);
-+ acpi_data->states[state_index].control = new_control;
-+
-+ } else {
-+ printk("skipping vid at %i, %u is greater than default %u\n",
-+ freq_index, new_vid, original_vid);
-+ }
-+
-+ curr_buf = next_buf;
-+ /* jump over value seperators (space or comma).
-+ * There could be more than one space or comma character
-+ * to separate two values so we better do it using a loop.
-+ */
-+ while ((curr_buf - buf < count) && ((*curr_buf == ' ') || (*curr_buf == ','))) {
-+ curr_buf++;
-+ }
-+ }
-+
-+ /* set new voltage for current frequency */
-+ data->resume = 1;
-+ acpi_cpufreq_target(policy, get_cur_freq_on_cpu(policy->cpu), CPUFREQ_RELATION_L);
-+
-+ return curr_buf - buf;
-+}
-+
-+static ssize_t store_freq_attr_controls(struct cpufreq_policy *policy, const char *buf, size_t count)
-+ /* store the controls (frequency id's and related voltage id's)
-+ * We are going to do some sanity checks here to prevent users
-+ * from setting higher voltages than the default one.
-+ */
-+{
-+ struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu);
-+ struct acpi_processor_performance *acpi_data;
-+ struct cpufreq_frequency_table *freq_table;
-+ const char *curr_buf;
-+ unsigned int op_count;
-+ unsigned int state_index;
-+ int isok;
-+ char *next_buf;
-+ ssize_t retval;
-+ unsigned int new_vid;
-+ unsigned int original_vid;
-+ unsigned int new_fid;
-+ unsigned int old_fid;
-+ unsigned int original_control;
-+ unsigned int old_control;
-+ unsigned int new_control;
-+ int found;
-+
-+ if (!check_cpu_control_capability(data)) return -ENODEV;
-+
-+ retval = check_origial_table(data);
-+ if (0 != retval)
-+ return retval;
-+
-+ acpi_data = data->acpi_data;
-+ freq_table = data->freq_table;
-+
-+ op_count = 0;
-+ curr_buf = buf;
-+ next_buf = NULL;
-+ isok = 1;
-+
-+ while ( (isok) && (curr_buf != NULL) )
-+ {
-+ op_count++;
-+ // Parse fid
-+ new_fid = simple_strtoul(curr_buf, &next_buf, 10);
-+ if ((next_buf != curr_buf) && (next_buf != NULL))
-+ {
-+ // Parse separator between frequency and voltage
-+ curr_buf = next_buf;
-+ next_buf = NULL;
-+ if (*curr_buf==':')
-+ {
-+ curr_buf++;
-+ // Parse vid
-+ new_vid = simple_strtoul(curr_buf, &next_buf, 10);
-+ if ((next_buf != curr_buf) && (next_buf != NULL))
-+ {
-+ found = 0;
-+ for (state_index = 0; state_index < acpi_data->state_count; state_index++) {
-+ old_control = acpi_data->states[state_index].control;
-+ old_fid = extract_fid_from_control(old_control);
-+ if (new_fid == old_fid)
-+ {
-+ found = 1;
-+ original_control = data->original_controls[state_index];
-+ original_vid = extract_vid_from_control(original_control);
-+ if (new_vid <= original_vid)
-+ {
-+ new_control = (original_control & ~INTEL_MSR_VID_MASK) | new_vid;
-+ dprintk("setting control at %i to %x (default is %x)\n",
-+ state_index, new_control, original_control);
-+ acpi_data->states[state_index].control = new_control;
-+
-+ } else {
-+ printk("skipping vid at %i, %u is greater than default %u\n",
-+ state_index, new_vid, original_vid);
-+ }
-+ }
-+ }
-+
-+ if (found == 0)
-+ {
-+ printk("operating point # %u not found (FID = %u)\n", op_count, new_fid);
-+ isok = 0;
-+ }
-+
-+ // Parse seprator before next operating point, if any
-+ curr_buf = next_buf;
-+ next_buf = NULL;
-+ if ((*curr_buf == ',') || (*curr_buf == ' '))
-+ curr_buf++;
-+ else
-+ curr_buf = NULL;
-+ }
-+ else
-+ {
-+ printk("failed to parse VID of operating point # %u (%s)\n", op_count, curr_buf);
-+ isok = 0;
-+ }
-+ }
-+ else
-+ {
-+ printk("failed to parse operating point # %u (%s)\n", op_count, curr_buf);
-+ isok = 0;
-+ }
-+ }
-+ else
-+ {
-+ printk("failed to parse FID of operating point # %u (%s)\n", op_count, curr_buf);
-+ isok = 0;
-+ }
-+ }
-+
-+ if (isok)
-+ {
-+ retval = count;
-+ /* set new voltage at current frequency */
-+ data->resume = 1;
-+ acpi_cpufreq_target(policy, get_cur_freq_on_cpu(policy->cpu), CPUFREQ_RELATION_L);
-+ }
-+ else
-+ {
-+ retval = -EINVAL;
-+ }
-+
-+ return retval;
-+}
-+
-+static ssize_t show_freq_attr_phc_version(struct cpufreq_policy *policy, char *buf)
-+ /* print out the phc version string set at the beginning of that file
-+ */
-+{
-+ ssize_t count = 0;
-+ count += sprintf(&buf[count], "%s\n", PHC_VERSION_STRING);
-+ return count;
-+}
-+
-+
-+
-+static struct freq_attr cpufreq_freq_attr_phc_version =
-+{
-+ /*display phc's version string*/
-+ .attr = { .name = "phc_version", .mode = 0444 },
-+ .show = show_freq_attr_phc_version,
-+ .store = NULL,
-+};
-+
-+static struct freq_attr cpufreq_freq_attr_vids =
-+{
-+ /*display phc's voltage id's for the cpu*/
-+ .attr = { .name = "phc_vids", .mode = 0644 },
-+ .show = show_freq_attr_vids,
-+ .store = store_freq_attr_vids,
-+};
-+
-+static struct freq_attr cpufreq_freq_attr_default_vids =
-+{
-+ /*display acpi's default frequency id's for the cpu*/
-+ .attr = { .name = "phc_default_vids", .mode = 0444 },
-+ .show = show_freq_attr_default_vids,
-+ .store = NULL,
-+};
-+
-+static struct freq_attr cpufreq_freq_attr_fids =
-+{
-+ /*display phc's default frequency id's for the cpu*/
-+ .attr = { .name = "phc_fids", .mode = 0444 },
-+ .show = show_freq_attr_fids,
-+ .store = NULL,
-+};
-+
-+static struct freq_attr cpufreq_freq_attr_controls =
-+{
-+ /*display phc's current voltage/frequency controls for the cpu*/
-+ .attr = { .name = "phc_controls", .mode = 0644 },
-+ .show = show_freq_attr_controls,
-+ .store = store_freq_attr_controls,
-+};
-+
-+static struct freq_attr cpufreq_freq_attr_default_controls =
-+{
-+ /*display acpi's default voltage/frequency controls for the cpu*/
-+ .attr = { .name = "phc_default_controls", .mode = 0444 },
-+ .show = show_freq_attr_default_controls,
-+ .store = NULL,
-+};
-+
- static struct freq_attr *acpi_cpufreq_attr[] = {
-- &cpufreq_freq_attr_scaling_available_freqs,
-+ &cpufreq_freq_attr_scaling_available_freqs,
-+ &cpufreq_freq_attr_phc_version,
-+ &cpufreq_freq_attr_vids,
-+ &cpufreq_freq_attr_default_vids,
-+ &cpufreq_freq_attr_fids,
-+ &cpufreq_freq_attr_controls,
-+ &cpufreq_freq_attr_default_controls,
- NULL,
- };
-
diff --git a/sys-power/phc-intel/files/phc-intel-0.3.2.12.1-2.6.37.patch b/sys-power/phc-intel/files/phc-intel-0.3.2.12.1-2.6.37.patch
deleted file mode 100644
index 4789d84939b6..000000000000
--- a/sys-power/phc-intel/files/phc-intel-0.3.2.12.1-2.6.37.patch
+++ /dev/null
@@ -1,528 +0,0 @@
---- linux-2.6.37-gentoo/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
-+++ phc-intel-0.3.2-12-1/phc-intel.c
-@@ -25,6 +25,10 @@
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- */
-
-+/* This file has been patched with Linux PHC: www.linux-phc.org
-+* Patch version: linux-phc-0.3.2
-+*/
-+
- #include <linux/kernel.h>
- #include <linux/module.h>
- #include <linux/init.h>
-@@ -61,12 +65,17 @@
- };
-
- #define INTEL_MSR_RANGE (0xffff)
-+#define INTEL_MSR_VID_MASK (0x00ff)
-+#define INTEL_MSR_FID_MASK (0xff00)
-+#define INTEL_MSR_FID_SHIFT (0x8)
-+#define PHC_VERSION_STRING "0.3.2:2"
-
- struct acpi_cpufreq_data {
- struct acpi_processor_performance *acpi_data;
- struct cpufreq_frequency_table *freq_table;
- unsigned int resume;
- unsigned int cpu_feature;
-+ acpi_integer *original_controls;
- };
-
- static DEFINE_PER_CPU(struct acpi_cpufreq_data *, acfreq_data);
-@@ -102,13 +111,14 @@
- static unsigned extract_msr(u32 msr, struct acpi_cpufreq_data *data)
- {
- int i;
-+ u32 fid;
- struct acpi_processor_performance *perf;
-
-- msr &= INTEL_MSR_RANGE;
-+ fid = msr & INTEL_MSR_FID_MASK;
- perf = data->acpi_data;
-
- for (i = 0; data->freq_table[i].frequency != CPUFREQ_TABLE_END; i++) {
-- if (msr == perf->states[data->freq_table[i].index].status)
-+ if (fid == (perf->states[data->freq_table[i].index].status & INTEL_MSR_FID_MASK))
- return data->freq_table[i].frequency;
- }
- return data->freq_table[0].frequency;
-@@ -701,6 +711,8 @@
- per_cpu(acfreq_data, policy->cpu) = NULL;
- acpi_processor_unregister_performance(data->acpi_data,
- policy->cpu);
-+ if (data->original_controls)
-+ kfree(data->original_controls);
- kfree(data->freq_table);
- kfree(data);
- }
-@@ -719,8 +731,470 @@
- return 0;
- }
-
-+/* sysfs interface to change operating points voltages */
-+
-+static unsigned int extract_fid_from_control(unsigned int control)
-+{
-+ return ((control & INTEL_MSR_FID_MASK) >> INTEL_MSR_FID_SHIFT);
-+}
-+
-+static unsigned int extract_vid_from_control(unsigned int control)
-+{
-+ return (control & INTEL_MSR_VID_MASK);
-+}
-+
-+
-+static bool check_cpu_control_capability(struct acpi_cpufreq_data *data) {
-+ /* check if the cpu we are running on is capable of setting new control data
-+ *
-+ */
-+ if (unlikely(data == NULL ||
-+ data->acpi_data == NULL ||
-+ data->freq_table == NULL ||
-+ data->cpu_feature != SYSTEM_INTEL_MSR_CAPABLE)) {
-+ return false;
-+ } else {
-+ return true;
-+ };
-+}
-+
-+
-+static ssize_t check_origial_table (struct acpi_cpufreq_data *data)
-+{
-+
-+ struct acpi_processor_performance *acpi_data;
-+ struct cpufreq_frequency_table *freq_table;
-+ unsigned int state_index;
-+
-+ acpi_data = data->acpi_data;
-+ freq_table = data->freq_table;
-+
-+ if (data->original_controls == NULL) {
-+ // Backup original control values
-+ data->original_controls = kcalloc(acpi_data->state_count,
-+ sizeof(acpi_integer), GFP_KERNEL);
-+ if (data->original_controls == NULL) {
-+ printk("failed to allocate memory for original control values\n");
-+ return -ENOMEM;
-+ }
-+ for (state_index = 0; state_index < acpi_data->state_count; state_index++) {
-+ data->original_controls[state_index] = acpi_data->states[state_index].control;
-+ }
-+ }
-+ return 0;
-+}
-+
-+static ssize_t show_freq_attr_vids(struct cpufreq_policy *policy, char *buf)
-+ /* display phc's voltage id's
-+ *
-+ */
-+{
-+ struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu);
-+ struct acpi_processor_performance *acpi_data;
-+ struct cpufreq_frequency_table *freq_table;
-+ unsigned int i;
-+ unsigned int vid;
-+ ssize_t count = 0;
-+
-+ if (!check_cpu_control_capability(data)) return -ENODEV; //check if CPU is capable of changing controls
-+
-+ acpi_data = data->acpi_data;
-+ freq_table = data->freq_table;
-+
-+ for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++) {
-+ vid = extract_vid_from_control(acpi_data->states[freq_table[i].index].control);
-+ count += sprintf(&buf[count], "%u ", vid);
-+ }
-+ count += sprintf(&buf[count], "\n");
-+
-+ return count;
-+}
-+
-+static ssize_t show_freq_attr_default_vids(struct cpufreq_policy *policy, char *buf)
-+ /* display acpi's default voltage id's
-+ *
-+ */
-+{
-+ struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu);
-+ struct cpufreq_frequency_table *freq_table;
-+ unsigned int i;
-+ unsigned int vid;
-+ ssize_t count = 0;
-+ ssize_t retval;
-+
-+ if (!check_cpu_control_capability(data)) return -ENODEV; //check if CPU is capable of changing controls
-+
-+ retval = check_origial_table(data);
-+ if (0 != retval)
-+ return retval;
-+
-+ freq_table = data->freq_table;
-+
-+ for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++) {
-+ vid = extract_vid_from_control(data->original_controls[freq_table[i].index]);
-+ count += sprintf(&buf[count], "%u ", vid);
-+ }
-+ count += sprintf(&buf[count], "\n");
-+
-+ return count;
-+}
-+
-+static ssize_t show_freq_attr_fids(struct cpufreq_policy *policy, char *buf)
-+ /* display phc's frequeny id's
-+ *
-+ */
-+{
-+ struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu);
-+ struct acpi_processor_performance *acpi_data;
-+ struct cpufreq_frequency_table *freq_table;
-+ unsigned int i;
-+ unsigned int fid;
-+ ssize_t count = 0;
-+
-+ if (!check_cpu_control_capability(data)) return -ENODEV; //check if CPU is capable of changing controls
-+
-+ acpi_data = data->acpi_data;
-+ freq_table = data->freq_table;
-+
-+ for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++) {
-+ fid = extract_fid_from_control(acpi_data->states[freq_table[i].index].control);
-+ count += sprintf(&buf[count], "%u ", fid);
-+ }
-+ count += sprintf(&buf[count], "\n");
-+
-+ return count;
-+}
-+
-+static ssize_t show_freq_attr_controls(struct cpufreq_policy *policy, char *buf)
-+ /* display phc's controls for the cpu (frequency id's and related voltage id's)
-+ *
-+ */
-+{
-+ struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu);
-+ struct acpi_processor_performance *acpi_data;
-+ struct cpufreq_frequency_table *freq_table;
-+ unsigned int i;
-+ unsigned int fid;
-+ unsigned int vid;
-+ ssize_t count = 0;
-+
-+ if (!check_cpu_control_capability(data)) return -ENODEV; //check if CPU is capable of changing controls
-+
-+ acpi_data = data->acpi_data;
-+ freq_table = data->freq_table;
-+
-+ for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++) {
-+ fid = extract_fid_from_control(acpi_data->states[freq_table[i].index].control);
-+ vid = extract_vid_from_control(acpi_data->states[freq_table[i].index].control);
-+ count += sprintf(&buf[count], "%u:%u ", fid, vid);
-+ }
-+ count += sprintf(&buf[count], "\n");
-+
-+ return count;
-+}
-+
-+static ssize_t show_freq_attr_default_controls(struct cpufreq_policy *policy, char *buf)
-+ /* display acpi's default controls for the cpu (frequency id's and related voltage id's)
-+ *
-+ */
-+{
-+ struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu);
-+ struct cpufreq_frequency_table *freq_table;
-+ unsigned int i;
-+ unsigned int fid;
-+ unsigned int vid;
-+ ssize_t count = 0;
-+ ssize_t retval;
-+
-+ if (!check_cpu_control_capability(data)) return -ENODEV; //check if CPU is capable of changing controls
-+
-+ retval = check_origial_table(data);
-+ if (0 != retval)
-+ return retval;
-+
-+ freq_table = data->freq_table;
-+
-+ for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++) {
-+ fid = extract_fid_from_control(data->original_controls[freq_table[i].index]);
-+ vid = extract_vid_from_control(data->original_controls[freq_table[i].index]);
-+ count += sprintf(&buf[count], "%u:%u ", fid, vid);
-+ }
-+ count += sprintf(&buf[count], "\n");
-+
-+ return count;
-+}
-+
-+
-+static ssize_t store_freq_attr_vids(struct cpufreq_policy *policy, const char *buf, size_t count)
-+ /* store the voltage id's for the related frequency
-+ * We are going to do some sanity checks here to prevent users
-+ * from setting higher voltages than the default one.
-+ */
-+{
-+ struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu);
-+ struct acpi_processor_performance *acpi_data;
-+ struct cpufreq_frequency_table *freq_table;
-+ unsigned int freq_index;
-+ unsigned int state_index;
-+ unsigned int new_vid;
-+ unsigned int original_vid;
-+ unsigned int new_control;
-+ unsigned int original_control;
-+ const char *curr_buf = buf;
-+ char *next_buf;
-+ ssize_t retval;
-+
-+ if (!check_cpu_control_capability(data)) return -ENODEV; //check if CPU is capable of changing controls
-+
-+ retval = check_origial_table(data);
-+ if (0 != retval)
-+ return retval;
-+
-+ acpi_data = data->acpi_data;
-+ freq_table = data->freq_table;
-+
-+ /* for each value taken from the sysfs interfalce (phc_vids) get entrys and convert them to unsigned long integers*/
-+ for (freq_index = 0; freq_table[freq_index].frequency != CPUFREQ_TABLE_END; freq_index++) {
-+ new_vid = simple_strtoul(curr_buf, &next_buf, 10);
-+ if (next_buf == curr_buf) {
-+ if ((curr_buf - buf == count - 1) && (*curr_buf == '\n')) { //end of line?
-+ curr_buf++;
-+ break;
-+ }
-+ //if we didn't got end of line but there is nothing more to read something went wrong...
-+ printk("failed to parse vid value at %i (%s)\n", freq_index, curr_buf);
-+ return -EINVAL;
-+ }
-+
-+ state_index = freq_table[freq_index].index;
-+ original_control = data->original_controls[state_index];
-+ original_vid = original_control & INTEL_MSR_VID_MASK;
-+
-+ /* before we store the values we do some checks to prevent
-+ * users to set up values higher than the default one
-+ */
-+ if (new_vid <= original_vid) {
-+ new_control = (original_control & ~INTEL_MSR_VID_MASK) | new_vid;
-+ pr_debug("setting control at %i to %x (default is %x)\n",
-+ freq_index, new_control, original_control);
-+ acpi_data->states[state_index].control = new_control;
-+
-+ } else {
-+ pr_debug("skipping vid at %i, %u is greater than default %u\n",
-+ freq_index, new_vid, original_vid);
-+ }
-+
-+ curr_buf = next_buf;
-+ /* jump over value seperators (space or comma).
-+ * There could be more than one space or comma character
-+ * to separate two values so we better do it using a loop.
-+ */
-+ while ((curr_buf - buf < count) && ((*curr_buf == ' ') || (*curr_buf == ','))) {
-+ curr_buf++;
-+ }
-+ }
-+
-+ /* set new voltage for current frequency */
-+ data->resume = 1;
-+ acpi_cpufreq_target(policy, get_cur_freq_on_cpu(policy->cpu), CPUFREQ_RELATION_L);
-+
-+ return curr_buf - buf;
-+}
-+
-+static ssize_t store_freq_attr_controls(struct cpufreq_policy *policy, const char *buf, size_t count)
-+ /* store the controls (frequency id's and related voltage id's)
-+ * We are going to do some sanity checks here to prevent users
-+ * from setting higher voltages than the default one.
-+ */
-+{
-+ struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu);
-+ struct acpi_processor_performance *acpi_data;
-+ struct cpufreq_frequency_table *freq_table;
-+ const char *curr_buf;
-+ unsigned int op_count;
-+ unsigned int state_index;
-+ int isok;
-+ char *next_buf;
-+ ssize_t retval;
-+ unsigned int new_vid;
-+ unsigned int original_vid;
-+ unsigned int new_fid;
-+ unsigned int old_fid;
-+ unsigned int original_control;
-+ unsigned int old_control;
-+ unsigned int new_control;
-+ int found;
-+
-+ if (!check_cpu_control_capability(data)) return -ENODEV;
-+
-+ retval = check_origial_table(data);
-+ if (0 != retval)
-+ return retval;
-+
-+ acpi_data = data->acpi_data;
-+ freq_table = data->freq_table;
-+
-+ op_count = 0;
-+ curr_buf = buf;
-+ next_buf = NULL;
-+ isok = 1;
-+
-+ while ( (isok) && (curr_buf != NULL) )
-+ {
-+ op_count++;
-+ // Parse fid
-+ new_fid = simple_strtoul(curr_buf, &next_buf, 10);
-+ if ((next_buf != curr_buf) && (next_buf != NULL))
-+ {
-+ // Parse separator between frequency and voltage
-+ curr_buf = next_buf;
-+ next_buf = NULL;
-+ if (*curr_buf==':')
-+ {
-+ curr_buf++;
-+ // Parse vid
-+ new_vid = simple_strtoul(curr_buf, &next_buf, 10);
-+ if ((next_buf != curr_buf) && (next_buf != NULL))
-+ {
-+ found = 0;
-+ for (state_index = 0; state_index < acpi_data->state_count; state_index++) {
-+ old_control = acpi_data->states[state_index].control;
-+ old_fid = extract_fid_from_control(old_control);
-+ if (new_fid == old_fid)
-+ {
-+ found = 1;
-+ original_control = data->original_controls[state_index];
-+ original_vid = extract_vid_from_control(original_control);
-+ if (new_vid <= original_vid)
-+ {
-+ new_control = (original_control & ~INTEL_MSR_VID_MASK) | new_vid;
-+ pr_debug("setting control at %i to %x (default is %x)\n",
-+ state_index, new_control, original_control);
-+ acpi_data->states[state_index].control = new_control;
-+
-+ } else {
-+ printk("skipping vid at %i, %u is greater than default %u\n",
-+ state_index, new_vid, original_vid);
-+ }
-+ }
-+ }
-+
-+ if (found == 0)
-+ {
-+ printk("operating point # %u not found (FID = %u)\n", op_count, new_fid);
-+ isok = 0;
-+ }
-+
-+ // Parse seprator before next operating point, if any
-+ curr_buf = next_buf;
-+ next_buf = NULL;
-+ if ((*curr_buf == ',') || (*curr_buf == ' '))
-+ curr_buf++;
-+ else
-+ curr_buf = NULL;
-+ }
-+ else
-+ {
-+ printk("failed to parse VID of operating point # %u (%s)\n", op_count, curr_buf);
-+ isok = 0;
-+ }
-+ }
-+ else
-+ {
-+ printk("failed to parse operating point # %u (%s)\n", op_count, curr_buf);
-+ isok = 0;
-+ }
-+ }
-+ else
-+ {
-+ printk("failed to parse FID of operating point # %u (%s)\n", op_count, curr_buf);
-+ isok = 0;
-+ }
-+ }
-+
-+ if (isok)
-+ {
-+ retval = count;
-+ /* set new voltage at current frequency */
-+ data->resume = 1;
-+ acpi_cpufreq_target(policy, get_cur_freq_on_cpu(policy->cpu), CPUFREQ_RELATION_L);
-+ }
-+ else
-+ {
-+ retval = -EINVAL;
-+ }
-+
-+ return retval;
-+}
-+
-+static ssize_t show_freq_attr_phc_version(struct cpufreq_policy *policy, char *buf)
-+ /* print out the phc version string set at the beginning of that file
-+ */
-+{
-+ ssize_t count = 0;
-+ count += sprintf(&buf[count], "%s\n", PHC_VERSION_STRING);
-+ return count;
-+}
-+
-+
-+
-+static struct freq_attr cpufreq_freq_attr_phc_version =
-+{
-+ /*display phc's version string*/
-+ .attr = { .name = "phc_version", .mode = 0444 },
-+ .show = show_freq_attr_phc_version,
-+ .store = NULL,
-+};
-+
-+static struct freq_attr cpufreq_freq_attr_vids =
-+{
-+ /*display phc's voltage id's for the cpu*/
-+ .attr = { .name = "phc_vids", .mode = 0644 },
-+ .show = show_freq_attr_vids,
-+ .store = store_freq_attr_vids,
-+};
-+
-+static struct freq_attr cpufreq_freq_attr_default_vids =
-+{
-+ /*display acpi's default frequency id's for the cpu*/
-+ .attr = { .name = "phc_default_vids", .mode = 0444 },
-+ .show = show_freq_attr_default_vids,
-+ .store = NULL,
-+};
-+
-+static struct freq_attr cpufreq_freq_attr_fids =
-+{
-+ /*display phc's default frequency id's for the cpu*/
-+ .attr = { .name = "phc_fids", .mode = 0444 },
-+ .show = show_freq_attr_fids,
-+ .store = NULL,
-+};
-+
-+static struct freq_attr cpufreq_freq_attr_controls =
-+{
-+ /*display phc's current voltage/frequency controls for the cpu*/
-+ .attr = { .name = "phc_controls", .mode = 0644 },
-+ .show = show_freq_attr_controls,
-+ .store = store_freq_attr_controls,
-+};
-+
-+static struct freq_attr cpufreq_freq_attr_default_controls =
-+{
-+ /*display acpi's default voltage/frequency controls for the cpu*/
-+ .attr = { .name = "phc_default_controls", .mode = 0444 },
-+ .show = show_freq_attr_default_controls,
-+ .store = NULL,
-+};
-+
-+
- static struct freq_attr *acpi_cpufreq_attr[] = {
- &cpufreq_freq_attr_scaling_available_freqs,
-+ &cpufreq_freq_attr_phc_version,
-+ &cpufreq_freq_attr_vids,
-+ &cpufreq_freq_attr_default_vids,
-+ &cpufreq_freq_attr_fids,
-+ &cpufreq_freq_attr_controls,
-+ &cpufreq_freq_attr_default_controls,
- NULL,
- };
-
diff --git a/sys-power/phc-intel/files/phc-intel-0.3.2.12.1-3.7.patch b/sys-power/phc-intel/files/phc-intel-0.3.2.12.1-3.7.patch
deleted file mode 100644
index 5d2949e92d46..000000000000
--- a/sys-power/phc-intel/files/phc-intel-0.3.2.12.1-3.7.patch
+++ /dev/null
@@ -1,534 +0,0 @@
---- hc-intel-0.3.2-12-1/phc-intel.c
-+++ hc-intel-0.3.2-12-1/phc-intel.c
-@@ -25,6 +25,10 @@
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- */
-
-+/* This file has been patched with Linux PHC: www.linux-phc.org
-+* Patch version: linux-phc-0.3.2
-+*/
-+
- #include <linux/kernel.h>
- #include <linux/module.h>
- #include <linux/init.h>
-@@ -61,6 +65,10 @@ enum {
- };
-
- #define INTEL_MSR_RANGE (0xffff)
-+#define INTEL_MSR_VID_MASK (0x00ff)
-+#define INTEL_MSR_FID_MASK (0xff00)
-+#define INTEL_MSR_FID_SHIFT (0x8)
-+#define PHC_VERSION_STRING "0.3.2:2"
- #define AMD_MSR_RANGE (0x7)
-
- #define MSR_K7_HWCR_CPB_DIS (1ULL << 25)
-@@ -70,6 +78,7 @@ struct acpi_cpufreq_data {
- struct cpufreq_frequency_table *freq_table;
- unsigned int resume;
- unsigned int cpu_feature;
-+ acpi_integer *original_controls;
- };
-
- static DEFINE_PER_CPU(struct acpi_cpufreq_data *, acfreq_data);
-@@ -222,17 +231,18 @@ static unsigned extract_io(u32 value, st
- static unsigned extract_msr(u32 msr, struct acpi_cpufreq_data *data)
- {
- int i;
-+ u32 fid;
- struct acpi_processor_performance *perf;
-
- if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD)
- msr &= AMD_MSR_RANGE;
- else
-- msr &= INTEL_MSR_RANGE;
-+ fid = msr & INTEL_MSR_FID_MASK;
-
- perf = data->acpi_data;
-
- for (i = 0; data->freq_table[i].frequency != CPUFREQ_TABLE_END; i++) {
-- if (msr == perf->states[data->freq_table[i].index].status)
-+ if (fid == (perf->states[data->freq_table[i].index].status & INTEL_MSR_FID_MASK))
- return data->freq_table[i].frequency;
- }
- return data->freq_table[0].frequency;
-@@ -868,6 +878,8 @@ static int acpi_cpufreq_cpu_init(struct
- return result;
-
- err_freqfree:
-+ if (data->original_controls)
-+ kfree(data->original_controls);
- kfree(data->freq_table);
- err_unreg:
- acpi_processor_unregister_performance(perf, cpu);
-@@ -907,8 +919,471 @@ static int acpi_cpufreq_resume(struct cp
- return 0;
- }
-
-+/* sysfs interface to change operating points voltages */
-+
-+static unsigned int extract_fid_from_control(unsigned int control)
-+{
-+ return ((control & INTEL_MSR_FID_MASK) >> INTEL_MSR_FID_SHIFT);
-+}
-+
-+static unsigned int extract_vid_from_control(unsigned int control)
-+{
-+ return (control & INTEL_MSR_VID_MASK);
-+}
-+
-+
-+static bool check_cpu_control_capability(struct acpi_cpufreq_data *data) {
-+ /* check if the cpu we are running on is capable of setting new control data
-+ *
-+ */
-+ if (unlikely(data == NULL ||
-+ data->acpi_data == NULL ||
-+ data->freq_table == NULL ||
-+ data->cpu_feature != SYSTEM_INTEL_MSR_CAPABLE)) {
-+ return false;
-+ } else {
-+ return true;
-+ };
-+}
-+
-+
-+static ssize_t check_origial_table (struct acpi_cpufreq_data *data)
-+{
-+
-+ struct acpi_processor_performance *acpi_data;
-+ struct cpufreq_frequency_table *freq_table;
-+ unsigned int state_index;
-+
-+ acpi_data = data->acpi_data;
-+ freq_table = data->freq_table;
-+
-+ if (data->original_controls == NULL) {
-+ // Backup original control values
-+ data->original_controls = kcalloc(acpi_data->state_count,
-+ sizeof(acpi_integer), GFP_KERNEL);
-+ if (data->original_controls == NULL) {
-+ printk("failed to allocate memory for original control values\n");
-+ return -ENOMEM;
-+ }
-+ for (state_index = 0; state_index < acpi_data->state_count; state_index++) {
-+ data->original_controls[state_index] = acpi_data->states[state_index].control;
-+ }
-+ }
-+ return 0;
-+}
-+
-+static ssize_t show_freq_attr_vids(struct cpufreq_policy *policy, char *buf)
-+ /* display phc's voltage id's
-+ *
-+ */
-+{
-+ struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu);
-+ struct acpi_processor_performance *acpi_data;
-+ struct cpufreq_frequency_table *freq_table;
-+ unsigned int i;
-+ unsigned int vid;
-+ ssize_t count = 0;
-+
-+ if (!check_cpu_control_capability(data)) return -ENODEV; //check if CPU is capable of changing controls
-+
-+ acpi_data = data->acpi_data;
-+ freq_table = data->freq_table;
-+
-+ for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++) {
-+ vid = extract_vid_from_control(acpi_data->states[freq_table[i].index].control);
-+ count += sprintf(&buf[count], "%u ", vid);
-+ }
-+ count += sprintf(&buf[count], "\n");
-+
-+ return count;
-+}
-+
-+static ssize_t show_freq_attr_default_vids(struct cpufreq_policy *policy, char *buf)
-+ /* display acpi's default voltage id's
-+ *
-+ */
-+{
-+ struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu);
-+ struct cpufreq_frequency_table *freq_table;
-+ unsigned int i;
-+ unsigned int vid;
-+ ssize_t count = 0;
-+ ssize_t retval;
-+
-+ if (!check_cpu_control_capability(data)) return -ENODEV; //check if CPU is capable of changing controls
-+
-+ retval = check_origial_table(data);
-+ if (0 != retval)
-+ return retval;
-+
-+ freq_table = data->freq_table;
-+
-+ for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++) {
-+ vid = extract_vid_from_control(data->original_controls[freq_table[i].index]);
-+ count += sprintf(&buf[count], "%u ", vid);
-+ }
-+ count += sprintf(&buf[count], "\n");
-+
-+ return count;
-+}
-+
-+static ssize_t show_freq_attr_fids(struct cpufreq_policy *policy, char *buf)
-+ /* display phc's frequeny id's
-+ *
-+ */
-+{
-+ struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu);
-+ struct acpi_processor_performance *acpi_data;
-+ struct cpufreq_frequency_table *freq_table;
-+ unsigned int i;
-+ unsigned int fid;
-+ ssize_t count = 0;
-+
-+ if (!check_cpu_control_capability(data)) return -ENODEV; //check if CPU is capable of changing controls
-+
-+ acpi_data = data->acpi_data;
-+ freq_table = data->freq_table;
-+
-+ for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++) {
-+ fid = extract_fid_from_control(acpi_data->states[freq_table[i].index].control);
-+ count += sprintf(&buf[count], "%u ", fid);
-+ }
-+ count += sprintf(&buf[count], "\n");
-+
-+ return count;
-+}
-+
-+static ssize_t show_freq_attr_controls(struct cpufreq_policy *policy, char *buf)
-+ /* display phc's controls for the cpu (frequency id's and related voltage id's)
-+ *
-+ */
-+{
-+ struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu);
-+ struct acpi_processor_performance *acpi_data;
-+ struct cpufreq_frequency_table *freq_table;
-+ unsigned int i;
-+ unsigned int fid;
-+ unsigned int vid;
-+ ssize_t count = 0;
-+
-+ if (!check_cpu_control_capability(data)) return -ENODEV; //check if CPU is capable of changing controls
-+
-+ acpi_data = data->acpi_data;
-+ freq_table = data->freq_table;
-+
-+ for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++) {
-+ fid = extract_fid_from_control(acpi_data->states[freq_table[i].index].control);
-+ vid = extract_vid_from_control(acpi_data->states[freq_table[i].index].control);
-+ count += sprintf(&buf[count], "%u:%u ", fid, vid);
-+ }
-+ count += sprintf(&buf[count], "\n");
-+
-+ return count;
-+}
-+
-+static ssize_t show_freq_attr_default_controls(struct cpufreq_policy *policy, char *buf)
-+ /* display acpi's default controls for the cpu (frequency id's and related voltage id's)
-+ *
-+ */
-+{
-+ struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu);
-+ struct cpufreq_frequency_table *freq_table;
-+ unsigned int i;
-+ unsigned int fid;
-+ unsigned int vid;
-+ ssize_t count = 0;
-+ ssize_t retval;
-+
-+ if (!check_cpu_control_capability(data)) return -ENODEV; //check if CPU is capable of changing controls
-+
-+ retval = check_origial_table(data);
-+ if (0 != retval)
-+ return retval;
-+
-+ freq_table = data->freq_table;
-+
-+ for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++) {
-+ fid = extract_fid_from_control(data->original_controls[freq_table[i].index]);
-+ vid = extract_vid_from_control(data->original_controls[freq_table[i].index]);
-+ count += sprintf(&buf[count], "%u:%u ", fid, vid);
-+ }
-+ count += sprintf(&buf[count], "\n");
-+
-+ return count;
-+}
-+
-+
-+static ssize_t store_freq_attr_vids(struct cpufreq_policy *policy, const char *buf, size_t count)
-+ /* store the voltage id's for the related frequency
-+ * We are going to do some sanity checks here to prevent users
-+ * from setting higher voltages than the default one.
-+ */
-+{
-+ struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu);
-+ struct acpi_processor_performance *acpi_data;
-+ struct cpufreq_frequency_table *freq_table;
-+ unsigned int freq_index;
-+ unsigned int state_index;
-+ unsigned int new_vid;
-+ unsigned int original_vid;
-+ unsigned int new_control;
-+ unsigned int original_control;
-+ const char *curr_buf = buf;
-+ char *next_buf;
-+ ssize_t retval;
-+
-+ if (!check_cpu_control_capability(data)) return -ENODEV; //check if CPU is capable of changing controls
-+
-+ retval = check_origial_table(data);
-+ if (0 != retval)
-+ return retval;
-+
-+ acpi_data = data->acpi_data;
-+ freq_table = data->freq_table;
-+
-+ /* for each value taken from the sysfs interfalce (phc_vids) get entrys and convert them to unsigned long integers*/
-+ for (freq_index = 0; freq_table[freq_index].frequency != CPUFREQ_TABLE_END; freq_index++) {
-+ new_vid = simple_strtoul(curr_buf, &next_buf, 10);
-+ if (next_buf == curr_buf) {
-+ if ((curr_buf - buf == count - 1) && (*curr_buf == '\n')) { //end of line?
-+ curr_buf++;
-+ break;
-+ }
-+ //if we didn't got end of line but there is nothing more to read something went wrong...
-+ printk("failed to parse vid value at %i (%s)\n", freq_index, curr_buf);
-+ return -EINVAL;
-+ }
-+
-+ state_index = freq_table[freq_index].index;
-+ original_control = data->original_controls[state_index];
-+ original_vid = original_control & INTEL_MSR_VID_MASK;
-+
-+ /* before we store the values we do some checks to prevent
-+ * users to set up values higher than the default one
-+ */
-+ if (new_vid <= original_vid) {
-+ new_control = (original_control & ~INTEL_MSR_VID_MASK) | new_vid;
-+ pr_debug("setting control at %i to %x (default is %x)\n",
-+ freq_index, new_control, original_control);
-+ acpi_data->states[state_index].control = new_control;
-+
-+ } else {
-+ pr_debug("skipping vid at %i, %u is greater than default %u\n",
-+ freq_index, new_vid, original_vid);
-+ }
-+
-+ curr_buf = next_buf;
-+ /* jump over value seperators (space or comma).
-+ * There could be more than one space or comma character
-+ * to separate two values so we better do it using a loop.
-+ */
-+ while ((curr_buf - buf < count) && ((*curr_buf == ' ') || (*curr_buf == ','))) {
-+ curr_buf++;
-+ }
-+ }
-+
-+ /* set new voltage for current frequency */
-+ data->resume = 1;
-+ acpi_cpufreq_target(policy, get_cur_freq_on_cpu(policy->cpu), CPUFREQ_RELATION_L);
-+
-+ return curr_buf - buf;
-+}
-+
-+static ssize_t store_freq_attr_controls(struct cpufreq_policy *policy, const char *buf, size_t count)
-+ /* store the controls (frequency id's and related voltage id's)
-+ * We are going to do some sanity checks here to prevent users
-+ * from setting higher voltages than the default one.
-+ */
-+{
-+ struct acpi_cpufreq_data *data = per_cpu(acfreq_data, policy->cpu);
-+ struct acpi_processor_performance *acpi_data;
-+ struct cpufreq_frequency_table *freq_table;
-+ const char *curr_buf;
-+ unsigned int op_count;
-+ unsigned int state_index;
-+ int isok;
-+ char *next_buf;
-+ ssize_t retval;
-+ unsigned int new_vid;
-+ unsigned int original_vid;
-+ unsigned int new_fid;
-+ unsigned int old_fid;
-+ unsigned int original_control;
-+ unsigned int old_control;
-+ unsigned int new_control;
-+ int found;
-+
-+ if (!check_cpu_control_capability(data)) return -ENODEV;
-+
-+ retval = check_origial_table(data);
-+ if (0 != retval)
-+ return retval;
-+
-+ acpi_data = data->acpi_data;
-+ freq_table = data->freq_table;
-+
-+ op_count = 0;
-+ curr_buf = buf;
-+ next_buf = NULL;
-+ isok = 1;
-+
-+ while ( (isok) && (curr_buf != NULL) )
-+ {
-+ op_count++;
-+ // Parse fid
-+ new_fid = simple_strtoul(curr_buf, &next_buf, 10);
-+ if ((next_buf != curr_buf) && (next_buf != NULL))
-+ {
-+ // Parse separator between frequency and voltage
-+ curr_buf = next_buf;
-+ next_buf = NULL;
-+ if (*curr_buf==':')
-+ {
-+ curr_buf++;
-+ // Parse vid
-+ new_vid = simple_strtoul(curr_buf, &next_buf, 10);
-+ if ((next_buf != curr_buf) && (next_buf != NULL))
-+ {
-+ found = 0;
-+ for (state_index = 0; state_index < acpi_data->state_count; state_index++) {
-+ old_control = acpi_data->states[state_index].control;
-+ old_fid = extract_fid_from_control(old_control);
-+ if (new_fid == old_fid)
-+ {
-+ found = 1;
-+ original_control = data->original_controls[state_index];
-+ original_vid = extract_vid_from_control(original_control);
-+ if (new_vid <= original_vid)
-+ {
-+ new_control = (original_control & ~INTEL_MSR_VID_MASK) | new_vid;
-+ pr_debug("setting control at %i to %x (default is %x)\n",
-+ state_index, new_control, original_control);
-+ acpi_data->states[state_index].control = new_control;
-+
-+ } else {
-+ printk("skipping vid at %i, %u is greater than default %u\n",
-+ state_index, new_vid, original_vid);
-+ }
-+ }
-+ }
-+
-+ if (found == 0)
-+ {
-+ printk("operating point # %u not found (FID = %u)\n", op_count, new_fid);
-+ isok = 0;
-+ }
-+
-+ // Parse seprator before next operating point, if any
-+ curr_buf = next_buf;
-+ next_buf = NULL;
-+ if ((*curr_buf == ',') || (*curr_buf == ' '))
-+ curr_buf++;
-+ else
-+ curr_buf = NULL;
-+ }
-+ else
-+ {
-+ printk("failed to parse VID of operating point # %u (%s)\n", op_count, curr_buf);
-+ isok = 0;
-+ }
-+ }
-+ else
-+ {
-+ printk("failed to parse operating point # %u (%s)\n", op_count, curr_buf);
-+ isok = 0;
-+ }
-+ }
-+ else
-+ {
-+ printk("failed to parse FID of operating point # %u (%s)\n", op_count, curr_buf);
-+ isok = 0;
-+ }
-+ }
-+
-+ if (isok)
-+ {
-+ retval = count;
-+ /* set new voltage at current frequency */
-+ data->resume = 1;
-+ acpi_cpufreq_target(policy, get_cur_freq_on_cpu(policy->cpu), CPUFREQ_RELATION_L);
-+ }
-+ else
-+ {
-+ retval = -EINVAL;
-+ }
-+
-+ return retval;
-+}
-+
-+static ssize_t show_freq_attr_phc_version(struct cpufreq_policy *policy, char *buf)
-+ /* print out the phc version string set at the beginning of that file
-+ */
-+{
-+ ssize_t count = 0;
-+ count += sprintf(&buf[count], "%s\n", PHC_VERSION_STRING);
-+ return count;
-+}
-+
-+
-+
-+static struct freq_attr cpufreq_freq_attr_phc_version =
-+{
-+ /*display phc's version string*/
-+ .attr = { .name = "phc_version", .mode = 0444 },
-+ .show = show_freq_attr_phc_version,
-+ .store = NULL,
-+};
-+
-+static struct freq_attr cpufreq_freq_attr_vids =
-+{
-+ /*display phc's voltage id's for the cpu*/
-+ .attr = { .name = "phc_vids", .mode = 0644 },
-+ .show = show_freq_attr_vids,
-+ .store = store_freq_attr_vids,
-+};
-+
-+static struct freq_attr cpufreq_freq_attr_default_vids =
-+{
-+ /*display acpi's default frequency id's for the cpu*/
-+ .attr = { .name = "phc_default_vids", .mode = 0444 },
-+ .show = show_freq_attr_default_vids,
-+ .store = NULL,
-+};
-+
-+static struct freq_attr cpufreq_freq_attr_fids =
-+{
-+ /*display phc's default frequency id's for the cpu*/
-+ .attr = { .name = "phc_fids", .mode = 0444 },
-+ .show = show_freq_attr_fids,
-+ .store = NULL,
-+};
-+
-+static struct freq_attr cpufreq_freq_attr_controls =
-+{
-+ /*display phc's current voltage/frequency controls for the cpu*/
-+ .attr = { .name = "phc_controls", .mode = 0644 },
-+ .show = show_freq_attr_controls,
-+ .store = store_freq_attr_controls,
-+};
-+
-+static struct freq_attr cpufreq_freq_attr_default_controls =
-+{
-+ /*display acpi's default voltage/frequency controls for the cpu*/
-+ .attr = { .name = "phc_default_controls", .mode = 0444 },
-+ .show = show_freq_attr_default_controls,
-+ .store = NULL,
-+};
-+
-+
-+
- static struct freq_attr *acpi_cpufreq_attr[] = {
- &cpufreq_freq_attr_scaling_available_freqs,
-+ &cpufreq_freq_attr_phc_version,
-+ &cpufreq_freq_attr_vids,
-+ &cpufreq_freq_attr_default_vids,
-+ &cpufreq_freq_attr_fids,
-+ &cpufreq_freq_attr_controls,
-+ &cpufreq_freq_attr_default_controls,
- NULL, /* this is a placeholder for cpb, do not remove */
- NULL,
- };
diff --git a/sys-power/phc-intel/files/phc-intel-0.3.2.12.11-trailing-space.patch b/sys-power/phc-intel/files/phc-intel-0.3.2.12.11-trailing-space.patch
new file mode 100644
index 000000000000..576c9211786d
--- /dev/null
+++ b/sys-power/phc-intel/files/phc-intel-0.3.2.12.11-trailing-space.patch
@@ -0,0 +1,11 @@
+--- phc-intel-pack-rev11/acpi-cpufreq.c
++++ phc-intel-pack-rev11/acpi-cpufreq.c
+@@ -1175,6 +1175,8 @@
+ vid = extract_vid_from_control(data->original_controls[freq_table[i].driver_data]);
+ count += sprintf(&buf[count], "%u:%u ", fid, vid);
+ }
++ if (count)
++ count--; //remove trailing space
+ count += sprintf(&buf[count], "\n");
+
+ return count;
diff --git a/sys-power/phc-intel/phc-intel-0.3.199.11_pre.ebuild b/sys-power/phc-intel/phc-intel-0.3.199.11_pre.ebuild
new file mode 100644
index 000000000000..55864efcb985
--- /dev/null
+++ b/sys-power/phc-intel/phc-intel-0.3.199.11_pre.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-power/phc-intel/phc-intel-0.3.199.11_pre.ebuild,v 1.1 2013/09/05 13:08:45 xmw Exp $
+
+EAPI=5
+
+inherit linux-info linux-mod eutils
+
+DESCRIPTION="Processor Hardware Control for Intel CPUs"
+HOMEPAGE="http://www.linux-phc.org/
+ http://www.linux-phc.org/forum/viewtopic.php?f=7&t=267"
+#no automatic filenames here, sorry
+SRC_URI="http://www.linux-phc.org/forum/download/file.php?id=147 -> phc-intel-pack-rev11.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS=""
+IUSE=""
+
+CONFIG_CHECK="~!X86_ACPI_CPUFREQ"
+ERROR_X86_ACPI_CPUFREQ="CONFIG_X86_ACPI_CPUFREQ has to be configured to Module to enable the replacement of acpi-cpufreq with phc-intel."
+
+MODULE_NAMES="phc-intel(misc:)"
+BUILD_PARAMS="KERNELSRC=\"${KERNEL_DIR}\" -j1"
+BUILD_TARGETS="all"
+
+S=${WORKDIR}/${A/.tar.bz2}
+
+pkg_setup() {
+ if kernel_is lt 2 6 27 ; then
+ eerror "Your kernel version is no longer supported by this version of ${PN}."
+ eerror "Please use a previous version of ${PN} or a newer kernel."
+ die
+ fi
+ if kernel_is gt 3 11 ; then
+ eerror "Your kernel version is not yet supported by this version of ${PN}."
+ eerror "Please use a newer version of ${PN} or an older kernel."
+ die
+ fi
+ linux-mod_pkg_setup
+}
+
+src_prepare() {
+ sed -e '/^all:/s:prepare::' \
+ -i Makefile || die
+
+ local my_sub=arch/x86/kernel/cpu
+ if kernel_is gt 2 6 39 ; then
+ my_sub=drivers
+ fi
+
+ cp -v "${KERNEL_DIR}"/${my_sub}/cpufreq/{acpi-cpufreq.c,mperf.h} . || die
+
+ if kernel_is lt 3 0 ; then
+ epatch inc/${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}/linux-phc-0.4.0.patch
+ else
+ epatch inc/${KV_MAJOR}.${KV_MINOR}/linux-phc-0.4.0.patch
+ fi
+ mv acpi-cpufreq.c phc-intel.c || die
+}
diff --git a/sys-power/phc-intel/phc-intel-0.3.199.3_pre.ebuild b/sys-power/phc-intel/phc-intel-0.3.199.3_pre.ebuild
deleted file mode 100644
index a45f3327f5e4..000000000000
--- a/sys-power/phc-intel/phc-intel-0.3.199.3_pre.ebuild
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright 1999-2010 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-power/phc-intel/phc-intel-0.3.199.3_pre.ebuild,v 1.1 2010/08/24 00:51:14 xmw Exp $
-
-EAPI=2
-
-inherit linux-info linux-mod versionator
-
-DESCRIPTION="Processor Hardware Control for Intel CPUs"
-HOMEPAGE="http://www.linux-phc.org/"
-SRC_URI="http://www.linux-phc.org/forum/download/file.php?id=86 -> ${P}.tar.bz2"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS=""
-IUSE=""
-
-S=${WORKDIR}/test-release-$(replace_version_separator 3 '-' $(get_version_component_range 1-4))
-
-CONFIG_CHECK="~!X86_ACPI_CPUFREQ"
-ERROR_X86_ACPI_CPUFREQ="CONFIG_X86_ACPI_CPUFREQ has to be configured to Module or Not set to enable the replacement of acpi-cpufreq with phc-intel."
-
-MODULE_NAMES="phc-intel(misc:)"
-BUILD_PARAMS="KERNELSRC=\"${KERNEL_DIR}\" -j1"
-BUILD_TARGETS="prepare all"
-
-pkg_setup() {
- if ! kernel_is eq 2 6 31 ; then
- elog "This testrelease only supports kernel version 2.6.31."
- die
- fi
- elog "Please read /usr/share/doc/${PVF}/README carefully"
- elog "before updating your current config"
-}
-
-src_install() {
- linux-mod_src_install
- newdoc "READ BEFORE INSTALL" README || die
-}
diff --git a/sys-power/phc-intel/phc-intel-0.3.2.12.1-r3.ebuild b/sys-power/phc-intel/phc-intel-0.3.2.12.1-r3.ebuild
deleted file mode 100644
index 6c00ae0243a9..000000000000
--- a/sys-power/phc-intel/phc-intel-0.3.2.12.1-r3.ebuild
+++ /dev/null
@@ -1,58 +0,0 @@
-# Copyright 1999-2012 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-power/phc-intel/phc-intel-0.3.2.12.1-r3.ebuild,v 1.3 2012/05/24 05:47:16 vapier Exp $
-
-EAPI=2
-
-inherit linux-info linux-mod versionator eutils
-
-DESCRIPTION="Processor Hardware Control for Intel CPUs"
-HOMEPAGE="http://www.linux-phc.org/"
-SRC_URI="http://www.linux-phc.org/forum/download/file.php?id=94 -> ${P}.tar.bz2"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE=""
-
-S=${WORKDIR}/${PN}-$(replace_version_separator 3 '-' $(replace_version_separator 4 '-'))
-
-CONFIG_CHECK="~!X86_ACPI_CPUFREQ"
-ERROR_X86_ACPI_CPUFREQ="CONFIG_X86_ACPI_CPUFREQ has to be configured to Module to enable the replacement of acpi-cpufreq with phc-intel."
-
-MODULE_NAMES="phc-intel(misc:)"
-BUILD_PARAMS="KERNELSRC=\"${KERNEL_DIR}\" -j1"
-BUILD_TARGETS="all"
-
-pkg_setup() {
- if kernel_is lt 2 6 33 ; then
- eerror "Your kernel version is no longer supported by this version of ${PN}."
- eerror "Please use a previous version of ${PN} or a newer kernel."
- die
- fi
- linux-mod_pkg_setup
-}
-
-src_prepare() {
- sed -e '/^all:/s:prepare::' \
- -e '/error Only support for 2.6 series kernels/d' \
- -i Makefile || die
-
- local my_sub=arch/x86/kernel/cpu
- if kernel_is gt 2 6 39 ; then
- my_sub=drivers
- fi
- cp -v "${KERNEL_DIR}"/${my_sub}/cpufreq/acpi-cpufreq.c phc-intel.c || die
- cp -v "${KERNEL_DIR}"/${my_sub}/cpufreq/mperf.h . || die
-
- if kernel_is eq 2 6 35 || kernel_is eq 2 6 36 ; then
- epatch "${FILESDIR}"/${P}-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}.patch
- else
- epatch "${FILESDIR}"/${P}-2.6.37.patch
- fi
-}
-
-src_install() {
- linux-mod_src_install
- dodoc README || die
-}
diff --git a/sys-power/phc-intel/phc-intel-0.3.2.12.1-r4.ebuild b/sys-power/phc-intel/phc-intel-0.3.2.12.1-r4.ebuild
deleted file mode 100644
index e1d8f7f36d9e..000000000000
--- a/sys-power/phc-intel/phc-intel-0.3.2.12.1-r4.ebuild
+++ /dev/null
@@ -1,60 +0,0 @@
-# Copyright 1999-2012 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-power/phc-intel/phc-intel-0.3.2.12.1-r4.ebuild,v 1.1 2012/11/15 01:08:43 xmw Exp $
-
-EAPI=2
-
-inherit linux-info linux-mod versionator eutils
-
-DESCRIPTION="Processor Hardware Control for Intel CPUs"
-HOMEPAGE="http://www.linux-phc.org/"
-SRC_URI="http://www.linux-phc.org/forum/download/file.php?id=94 -> ${P}.tar.bz2"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE=""
-
-S=${WORKDIR}/${PN}-$(replace_version_separator 3 '-' $(replace_version_separator 4 '-'))
-
-CONFIG_CHECK="~!X86_ACPI_CPUFREQ"
-ERROR_X86_ACPI_CPUFREQ="CONFIG_X86_ACPI_CPUFREQ has to be configured to Module to enable the replacement of acpi-cpufreq with phc-intel."
-
-MODULE_NAMES="phc-intel(misc:)"
-BUILD_PARAMS="KERNELSRC=\"${KERNEL_DIR}\" -j1"
-BUILD_TARGETS="all"
-
-pkg_setup() {
- if kernel_is lt 2 6 33 ; then
- eerror "Your kernel version is no longer supported by this version of ${PN}."
- eerror "Please use a previous version of ${PN} or a newer kernel."
- die
- fi
- linux-mod_pkg_setup
-}
-
-src_prepare() {
- sed -e '/^all:/s:prepare::' \
- -e '/error Only support for 2.6 series kernels/d' \
- -i Makefile || die
-
- local my_sub=arch/x86/kernel/cpu
- if kernel_is gt 2 6 39 ; then
- my_sub=drivers
- fi
- cp -v "${KERNEL_DIR}"/${my_sub}/cpufreq/acpi-cpufreq.c phc-intel.c || die
- cp -v "${KERNEL_DIR}"/${my_sub}/cpufreq/mperf.h . || die
-
- if kernel_is eq 2 6 35 || kernel_is eq 2 6 36 ; then
- epatch "${FILESDIR}"/${P}-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}.patch
- elif kernel_is lt 3 7 ; then
- epatch "${FILESDIR}"/${P}-2.6.37.patch
- else
- epatch "${FILESDIR}"/${P}-3.7.patch
- fi
-}
-
-src_install() {
- linux-mod_src_install
- dodoc README || die
-}
diff --git a/sys-power/phc-intel/phc-intel-0.3.2.12.1-r5.ebuild b/sys-power/phc-intel/phc-intel-0.3.2.12.1-r5.ebuild
index 6acb5784c820..feaa2e6529e9 100644
--- a/sys-power/phc-intel/phc-intel-0.3.2.12.1-r5.ebuild
+++ b/sys-power/phc-intel/phc-intel-0.3.2.12.1-r5.ebuild
@@ -1,6 +1,6 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-power/phc-intel/phc-intel-0.3.2.12.1-r5.ebuild,v 1.1 2012/12/17 07:20:10 xmw Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-power/phc-intel/phc-intel-0.3.2.12.1-r5.ebuild,v 1.2 2013/09/05 13:08:45 xmw Exp $
EAPI=2
@@ -30,6 +30,11 @@ pkg_setup() {
eerror "Please use a previous version of ${PN} or a newer kernel."
die
fi
+ if kernel_is gt 3 10 ; then
+ eerror "Your kernel version is not supported by this version of ${PN}."
+ eerror "Please use a newer version for kernels 3.11 and above."
+ die
+ fi
linux-mod_pkg_setup
}
diff --git a/sys-power/phc-intel/phc-intel-0.3.2.12.11.ebuild b/sys-power/phc-intel/phc-intel-0.3.2.12.11.ebuild
new file mode 100644
index 000000000000..1bf7397d81aa
--- /dev/null
+++ b/sys-power/phc-intel/phc-intel-0.3.2.12.11.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-power/phc-intel/phc-intel-0.3.2.12.11.ebuild,v 1.1 2013/09/05 13:08:45 xmw Exp $
+
+EAPI=5
+
+inherit linux-info linux-mod eutils vcs-snapshot
+
+DESCRIPTION="Processor Hardware Control for Intel CPUs"
+HOMEPAGE="http://www.linux-phc.org/
+ http://www.linux-phc.org/forum/viewtopic.php?f=7&t=267"
+#no automatic filenames here, sorry
+SRC_URI="http://www.linux-phc.org/forum/download/file.php?id=147 -> phc-intel-pack-rev11.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+CONFIG_CHECK="~!X86_ACPI_CPUFREQ"
+ERROR_X86_ACPI_CPUFREQ="CONFIG_X86_ACPI_CPUFREQ has to be configured to Module to enable the replacement of acpi-cpufreq with phc-intel."
+
+MODULE_NAMES="phc-intel(misc:)"
+BUILD_PARAMS="KERNELSRC=\"${KERNEL_DIR}\" -j1"
+BUILD_TARGETS="all"
+
+S=${WORKDIR}/${A/.tar.bz2}
+
+pkg_setup() {
+ if kernel_is lt 2 6 27 ; then
+ eerror "Your kernel version is no longer supported by this version of ${PN}."
+ eerror "Please use a previous version of ${PN} or a newer kernel."
+ die
+ fi
+ if kernel_is gt 3 11 ; then
+ eerror "Your kernel version is not yet supported by this version of ${PN}."
+ eerror "Please use a newer version of ${PN} or an older kernel."
+ die
+ fi
+ linux-mod_pkg_setup
+}
+
+src_prepare() {
+ sed -e '/^all:/s:prepare::' \
+ -i Makefile || die
+
+ local my_sub=arch/x86/kernel/cpu
+ if kernel_is gt 2 6 39 ; then
+ my_sub=drivers
+ fi
+ cp -v "${KERNEL_DIR}"/${my_sub}/cpufreq/{acpi-cpufreq.c,mperf.h} . || die
+
+ if kernel_is lt 3 0 ; then
+ epatch inc/${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}/linux-phc-0.3.2.patch
+ else
+ epatch inc/${KV_MAJOR}.${KV_MINOR}/linux-phc-0.3.2.patch
+ fi
+
+ epatch "${FILESDIR}"/${P}-trailing-space.patch
+
+ mv acpi-cpufreq.c phc-intel.c || die
+}