Commit 63a84559 authored by Linus Torvalds's avatar Linus Torvalds

Merge http://linux-acpi.bkbits.net/linux-acpi

into penguin.transmeta.com:/home/penguin/torvalds/repositories/kernel/linux
parents 0b32ad59 dccb90df
......@@ -87,7 +87,8 @@ PowerNow! K6:
Transmeta Crusoe Longrun:
Transmeta Crusoe processors:
--------------------------------
Does not work with the 2.4. /proc/sys/cpu/ interface.
It is recommended to use the 2.6. /proc/cpufreq interface when
using this driver
......@@ -283,15 +284,17 @@ entries:
cpufreq_verify_t verify: This is a pointer to a function with the
following definition:
void verify_function (struct cpufreq_policy *policy).
int verify_function (struct cpufreq_policy *policy).
This function must verify the new policy is within the limits
supported by the CPU, and at least one supported CPU is within
this range. It may be useful to use cpufreq.h /
cpufreq_verify_within_limits for this.
cpufreq_verify_within_limits for this. If this is called with
CPUFREQ_ALL_CPUS, and there is no common subset of frequencies
for all CPUs, exit with an error.
cpufreq_setpolicy_t setpolicy: This is a pointer to a function with
the following definition:
void setpolicy_function (struct cpufreq_policy *policy).
int setpolicy_function (struct cpufreq_policy *policy).
This function must set the CPU to the new policy. If it is a
"dumb" CPU which only allows fixed frequencies to be set, it
shall set it to the lowest within the limit for
......@@ -302,30 +305,30 @@ cpufreq_setpolicy_t setpolicy: This is a pointer to a function with
struct cpufreq_policy *policy: This is an array of NR_CPUS struct
cpufreq_policies, containing the current policies set for these
CPUs. Note that policy[0].max_cpu_freq must contain the
absolute maximum CPU frequency supported by _all_ CPUs.
CPUs. Note that policy[cpu].max_cpu_freq must contain the
absolute maximum CPU frequency supported by the specified cpu.
In case the driver is expected to run with the 2.4.-style API
(/proc/sys/cpu/.../), two more values must be passed
#ifdef CONFIG_CPU_FREQ_24_API
unsigned int cpu_min_freq;
unsigned int cpu_min_freq[NR_CPUS];
unsigned int cpu_cur_freq[NR_CPUS];
#endif
with cpu_min_freq being the minimum CPU frequency supported by
the CPUs; and the entries in cpu_cur_freq reflecting the
current speed of the appropriate CPU.
with cpu_min_freq[cpu] being the minimum CPU frequency
supported by the CPU; and the entries in cpu_cur_freq
reflecting the current speed of the appropriate CPU.
Some Requirements to CPUFreq architecture drivers
-------------------------------------------------
* Only call cpufreq_register() when the ability to switch CPU
frequencies is _verified_ or can't be missing
frequencies is _verified_ or can't be missing. Also, all
other initialization must be done beofre this call, as
cpfureq_register calls the driver's verify and setpolicy code for
each CPU.
* cpufreq_unregister() may only be called if cpufreq_register() has
been successfully(!) called before.
* kfree() the struct cpufreq_driver only after the call to
cpufreq_unregister(), unless cpufreq_register() failed.
* Be aware that there is currently no error management in the
setpolicy() code in the CPUFreq core. So only call yourself a
cpufreq_driver if you are really a working cpufreq_driver!
......
Sony Programmable I/O Control Device Driver Readme
--------------------------------------------------
Copyright (C) 2001 Stelian Pop <stelian.pop@fr.alcove.com>, Alcôve
Copyright (C) 2001-2002 Stelian Pop <stelian@popies.net>
Copyright (C) 2001-2002 Alcôve <www.alcove.com>
Copyright (C) 2001 Michael Ashley <m.ashley@unsw.edu.au>
Copyright (C) 2001 Junichi Morita <jun1m@mars.dti.ne.jp>
Copyright (C) 2000 Takaya Kinjo <t-kinjo@tc4.so-net.ne.jp>
......@@ -15,14 +16,14 @@ generate, like:
- capture button events (only on Vaio Picturebook series)
- Fn keys
- bluetooth button (only on C1VR model)
- back button (PCG-GR7/K model)
- lid open/close events (Z600NE model)
- programmable keys, back, help, zoom, thumbphrase buttons, etc.
(when available)
Those events (see linux/sonypi.h) can be polled using the character device node
/dev/sonypi (major 10, minor auto allocated or specified as a option).
A simple daemon which translates the jogdial movements into mouse wheel events
can be downloaded at: <http://www.alcove-labs.org/en/software/sonypi/>
can be downloaded at: <http://popies.net/sonypi/>
This driver supports also some ioctl commands for setting the LCD screen
brightness and querying the batteries charge information (some more
......@@ -43,7 +44,7 @@ Several options can be passed to the sonypi driver, either by adding them
to /etc/modules.conf file, when the driver is compiled as a module or by
adding the following to the kernel command line (in your bootloader):
sonypi=minor[,verbose[,fnkeyinit[,camera[,compat[,nojogdial]]]]]
sonypi=minor[,verbose[,fnkeyinit[,camera[,compat[,mask]]]]]
where:
......@@ -64,15 +65,36 @@ where:
with it and it shouldn't be required anyway if
ACPI is already enabled).
verbose: print unknown events from the sonypi device
verbose: set to 1 to print unknown events received from the
sonypi device.
set to 2 to print all events received from the
sonypi device.
compat: uses some compatibility code for enabling the sonypi
events. If the driver worked for you in the past
(prior to version 1.5) and does not work anymore,
add this option and report to the author.
nojogdial: gives more accurate PKEY events on those Vaio models
which don't have a jogdial (like the FX series).
mask: event mask telling the driver what events will be
reported to the user. This parameter is required for some
Vaio models where the hardware reuses values used in
other Vaio models (like the FX series who does not
have a jogdial but reuses the jogdial events for
programmable keys events). The default event mask is
set to 0xffffffff, meaning that all possible events will be
tried. You can use the following bits to construct
your own event mask (from drivers/char/sonypi.h):
SONYPI_JOGGER_MASK 0x0001
SONYPI_CAPTURE_MASK 0x0002
SONYPI_FNKEY_MASK 0x0004
SONYPI_BLUETOOTH_MASK 0x0008
SONYPI_PKEY_MASK 0x0010
SONYPI_BACK_MASK 0x0020
SONYPI_HELP_MASK 0x0040
SONYPI_LID_MASK 0x0080
SONYPI_ZOOM_MASK 0x0100
SONYPI_THUMBPHRASE_MASK 0x0200
SONYPI_MEYE_MASK 0x0400
Module use:
-----------
......
Vaio Picturebook Motion Eye Camera Driver Readme
------------------------------------------------
Copyright (C) 2001 Stelian Pop <stelian.pop@fr.alcove.com>, Alcôve
Copyright (C) 2001-2002 Stelian Pop <stelian@popies.net>
Copyright (C) 2001-2002 Alcôve <www.alcove.com>
Copyright (C) 2000 Andrew Tridgell <tridge@samba.org>
This driver enable the use of video4linux compatible applications with the
......@@ -52,7 +53,7 @@ Usage:
or
xawtv -c /dev/video0 -geometry 320x240
motioneye (<http://www.alcove-labs.org/en/software/meye/>)
motioneye (<http://popies.net/meye/>)
for getting ppm or jpg snapshots, mjpeg video
Private API:
......
......@@ -73,7 +73,7 @@ static struct vco freq_to_vco(unsigned int freq_khz, int factor)
* Validate the speed in khz. If it is outside our
* range, then return the lowest.
*/
static void integrator_verify_speed(struct cpufreq_policy *policy)
static int integrator_verify_speed(struct cpufreq_policy *policy)
{
struct vco vco;
......@@ -93,6 +93,8 @@ static void integrator_verify_speed(struct cpufreq_policy *policy)
vco.vdw = 152;
policy->min = policy->max = vco_to_freq(vco, 1);
return 0;
}
static void do_set_policy(int cpu, struct cpufreq_policy *policy)
......@@ -116,7 +118,7 @@ static void do_set_policy(int cpu, struct cpufreq_policy *policy)
__raw_writel(0, CM_LOCK);
}
static void integrator_set_policy(struct cpufreq_policy *policy)
static int integrator_set_policy(struct cpufreq_policy *policy)
{
unsigned long cpus_allowed;
int cpu;
......@@ -139,6 +141,8 @@ static void integrator_set_policy(struct cpufreq_policy *policy)
* Restore the CPUs allowed mask.
*/
set_cpus_allowed(current, cpus_allowed);
return 0;
}
static struct cpufreq_policy integrator_policy = {
......@@ -151,7 +155,6 @@ static struct cpufreq_driver integrator_driver = {
.verify = integrator_verify_speed,
.setpolicy = integrator_set_policy,
.policy = &integrator_policy,
.cpu_min_freq = 12000,
};
#endif
......@@ -202,6 +205,8 @@ static int __init integrator_cpu_init(void)
set_cpus_allowed(current, cpus_allowed);
#ifdef CONFIG_CPU_FREQ
for (cpu=0; cpu<NR_CPUS; cpu++)
integrator_driver.cpu_min_freq[cpu] = 12000;
integrator_driver.policy = policies;
cpufreq_register(&integrator_driver);
#else
......
......@@ -176,7 +176,7 @@ static void sa1100_update_dram_timings(int current_speed, int new_speed)
}
}
static void sa1100_setspeed(struct cpufreq_policy *policy)
static int sa1100_setspeed(struct cpufreq_policy *policy)
{
unsigned int cur = sa11x0_getspeed();
struct cpufreq_freqs freqs;
......@@ -196,6 +196,8 @@ static void sa1100_setspeed(struct cpufreq_policy *policy)
sa1100_update_dram_timings(cur, policy->max);
cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
return 0;
}
static struct cpufreq_policy sa1100_policy = {
......@@ -208,7 +210,7 @@ static struct cpufreq_driver sa1100_driver = {
.verify = sa11x0_verify_speed,
.setpolicy = sa1100_setspeed,
.policy = &sa1100_policy,
.cpu_min_freq = 59000,
.cpu_min_freq[0]= 59000,
};
static int __init sa1100_dram_init(void)
......@@ -216,7 +218,7 @@ static int __init sa1100_dram_init(void)
int ret = -ENODEV;
if ((processor_id & CPU_SA1100_MASK) == CPU_SA1100_ID) {
sa1100_driver.cpu_curr_freq[0] =
sa1100_driver.cpu_cur_freq[0] =
sa1100_policy.min =
sa1100_policy.max = sa11x0_getspeed();
......
......@@ -212,7 +212,7 @@ sdram_update_refresh(u_int cpu_khz, struct sdram_params *sdram)
* above, we can match for an exact frequency. If we don't find
* an exact match, we will to set the lowest frequency to be safe.
*/
static void sa1110_setspeed(struct cpufreq_policy *policy)
static int sa1110_setspeed(struct cpufreq_policy *policy)
{
struct sdram_params *sdram = &sdram_params;
struct cpufreq_freqs freqs;
......@@ -291,6 +291,8 @@ static void sa1110_setspeed(struct cpufreq_policy *policy)
sdram_update_refresh(policy->max, sdram);
cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
return 0;
}
static struct cpufreq_policy sa1110_policy = {
......@@ -300,10 +302,10 @@ static struct cpufreq_policy sa1110_policy = {
};
static struct cpufreq_driver sa1110_driver = {
.verify = sa11x0_verify_speed,
.setpolicy = sa1110_setspeed,
.policy = &sa1110_policy,
.cpu_min_freq = 59000,
.verify = sa11x0_verify_speed,
.setpolicy = sa1110_setspeed,
.policy = &sa1110_policy,
.cpu_min_freq[0] = 59000,
};
static int __init sa1110_clk_init(void)
......
......@@ -67,7 +67,7 @@ unsigned int sa11x0_freq_to_ppcr(unsigned int khz)
* scaling, so we force min=max, and set the policy to "performance".
* If we can't generate the precise frequency requested, round it up.
*/
void sa11x0_verify_speed(struct cpufreq_policy *policy)
int sa11x0_verify_speed(struct cpufreq_policy *policy)
{
if (policy->max > policy->max_cpu_freq)
policy->max = policy->max_cpu_freq;
......@@ -75,6 +75,7 @@ void sa11x0_verify_speed(struct cpufreq_policy *policy)
policy->max = cclk_frequency_100khz[sa11x0_freq_to_ppcr(policy->max)] * 100;
policy->min = policy->max;
policy->policy = CPUFREQ_POLICY_POWERSAVE;
return 0;
}
unsigned int sa11x0_getspeed(void)
......
......@@ -172,13 +172,13 @@ static void elanfreq_set_cpu_state (unsigned int state) {
* for the hardware supported by the driver.
*/
static void elanfreq_verify (struct cpufreq_policy *policy)
static int elanfreq_verify (struct cpufreq_policy *policy)
{
unsigned int number_states = 0;
unsigned int i;
if (!policy || !max_freq)
return;
return -EINVAL;
policy->cpu = 0;
......@@ -190,7 +190,7 @@ static void elanfreq_verify (struct cpufreq_policy *policy)
number_states++;
if (number_states)
return;
return 0;
for (i=(sizeof(elan_multiplier)/sizeof(struct s_elan_multiplier) - 1); i>=0; i--)
if (elan_multiplier[i].clock < policy->max)
......@@ -198,16 +198,16 @@ static void elanfreq_verify (struct cpufreq_policy *policy)
policy->max = elan_multiplier[i+1].clock;
return;
return 0;
}
static void elanfreq_setpolicy (struct cpufreq_policy *policy)
static int elanfreq_setpolicy (struct cpufreq_policy *policy)
{
unsigned int number_states = 0;
unsigned int i, j=4;
if (!elanfreq_driver)
return;
return -EINVAL;
for (i=(sizeof(elan_multiplier)/sizeof(struct s_elan_multiplier) - 1); i>=0; i--)
if ((elan_multiplier[i].clock >= policy->min) &&
......@@ -219,7 +219,7 @@ static void elanfreq_setpolicy (struct cpufreq_policy *policy)
if (number_states == 1) {
elanfreq_set_cpu_state(j);
return;
return 0;
}
switch (policy->policy) {
......@@ -236,14 +236,14 @@ static void elanfreq_setpolicy (struct cpufreq_policy *policy)
j = i;
break;
default:
return;
return -EINVAL;
}
if (elan_multiplier[j].clock > max_freq)
BUG();
return -EINVAL;
elanfreq_set_cpu_state(j);
return;
return 0;
}
......@@ -296,7 +296,7 @@ static int __init elanfreq_init(void)
max_freq = elanfreq_get_cpu_frequency();
#ifdef CONFIG_CPU_FREQ_24_API
driver->cpu_min_freq = 1000;
driver->cpu_min_freq[0] = 1000;
driver->cpu_cur_freq[0] = elanfreq_get_cpu_frequency();
#endif
......@@ -309,15 +309,15 @@ static int __init elanfreq_init(void)
driver->policy[0].policy = CPUFREQ_POLICY_PERFORMANCE;
driver->policy[0].max_cpu_freq = max_freq;
elanfreq_driver = driver;
ret = cpufreq_register(driver);
if (ret) {
elanfreq_driver = NULL;
kfree(driver);
return ret;
}
elanfreq_driver = driver;
return 0;
return ret;
}
......
/*
* $Id: longhaul.c,v 1.72 2002/09/29 23:43:10 db Exp $
* $Id: longhaul.c,v 1.77 2002/10/31 21:17:40 db Exp $
*
* (C) 2001 Dave Jones. <davej@suse.de>
* (C) 2002 Padraig Brady. <padraig@antefacto.com>
......@@ -436,8 +436,10 @@ static void __init longhaul_get_ranges (void)
switch (longhaul) {
case 1:
/* Ugh, Longhaul v1 didn't have the min/max MSRs.
Assume max = whatever we booted at. */
Assume min=3.0x & max = whatever we booted at. */
minmult = 30;
maxmult = longhaul_get_cpu_mult();
minfsb = maxfsb = current_fsb;
break;
case 2 ... 3:
......@@ -531,7 +533,7 @@ static inline unsigned int longhaul_statecount_fsb(struct cpufreq_policy *policy
}
static void longhaul_verify(struct cpufreq_policy *policy)
static int longhaul_verify(struct cpufreq_policy *policy)
{
unsigned int number_states = 0;
unsigned int i;
......@@ -540,7 +542,7 @@ static void longhaul_verify(struct cpufreq_policy *policy)
unsigned int newmax = -1;
if (!policy || !longhaul_driver)
return;
return -EINVAL;
policy->cpu = 0;
cpufreq_verify_within_limits(policy, lowest_speed, highest_speed);
......@@ -552,7 +554,7 @@ static void longhaul_verify(struct cpufreq_policy *policy)
number_states = longhaul_statecount_fsb(policy, current_fsb);
if (number_states)
return;
return 0;
/* get frequency closest above current policy->max */
if (can_scale_fsb==1) {
......@@ -579,10 +581,12 @@ static void longhaul_verify(struct cpufreq_policy *policy)
}
policy->max = newmax;
return 0;
}
static void longhaul_setpolicy (struct cpufreq_policy *policy)
static int longhaul_setpolicy (struct cpufreq_policy *policy)
{
unsigned int number_states = 0;
unsigned int i;
......@@ -592,7 +596,7 @@ static void longhaul_setpolicy (struct cpufreq_policy *policy)
unsigned int best_freq = -1;
if (!longhaul_driver)
return;
return -EINVAL;
if (policy->policy==CPUFREQ_POLICY_PERFORMANCE)
fsb_search_table = perf_fsb_table;
......@@ -613,7 +617,7 @@ static void longhaul_setpolicy (struct cpufreq_policy *policy)
}
if (!number_states)
return;
return -EINVAL;
else if (number_states == 1) {
for(i=0; i<numscales; i++) {
if ((clock_ratio[i] != -1) &&
......@@ -692,11 +696,11 @@ static void longhaul_setpolicy (struct cpufreq_policy *policy)
}
break;
default:
return;
return -EINVAL;
}
longhaul_setstate(new_clock_ratio, new_fsb);
return;
return 0;
}
......@@ -775,7 +779,7 @@ static int __init longhaul_init (void)
driver->policy = (struct cpufreq_policy *) (driver + 1);
#ifdef CONFIG_CPU_FREQ_24_API
driver->cpu_min_freq = (unsigned int) lowest_speed;
driver->cpu_min_freq[0] = (unsigned int) lowest_speed;
driver->cpu_cur_freq[0] = currentspeed;
#endif
......@@ -788,15 +792,15 @@ static int __init longhaul_init (void)
driver->policy[0].policy = CPUFREQ_POLICY_PERFORMANCE;
driver->policy[0].max_cpu_freq = (unsigned int) highest_speed;
ret = cpufreq_register(driver);
longhaul_driver = driver;
ret = cpufreq_register(driver);
if (ret) {
longhaul_driver = NULL;
kfree(driver);
return ret;
}
longhaul_driver = driver;
return 0;
return ret;
}
......
/*
* $Id: longrun.c,v 1.12 2002/09/29 23:43:10 db Exp $
* $Id: longrun.c,v 1.14 2002/10/31 21:17:40 db Exp $
*
* (C) 2002 Dominik Brodowski <linux@brodo.de>
*
......@@ -67,13 +67,13 @@ static void longrun_get_policy(struct cpufreq_policy *policy)
* Sets a new CPUFreq policy on LongRun-capable processors. This function
* has to be called with cpufreq_driver locked.
*/
static void longrun_set_policy(struct cpufreq_policy *policy)
static int longrun_set_policy(struct cpufreq_policy *policy)
{
u32 msr_lo, msr_hi;
u32 pctg_lo, pctg_hi;
if (!longrun_driver || !policy)
return;
return -EINVAL;
pctg_lo = (policy->min - longrun_low_freq) /
((longrun_high_freq - longrun_low_freq) / 100);
......@@ -105,7 +105,7 @@ static void longrun_set_policy(struct cpufreq_policy *policy)
msr_hi |= pctg_hi;
wrmsr(MSR_TMTA_LONGRUN_CTRL, msr_lo, msr_hi);
return;
return 0;
}
......@@ -115,16 +115,16 @@ static void longrun_set_policy(struct cpufreq_policy *policy)
* Validates a new CPUFreq policy. This function has to be called with
* cpufreq_driver locked.
*/
static void longrun_verify_policy(struct cpufreq_policy *policy)
static int longrun_verify_policy(struct cpufreq_policy *policy)
{
if (!policy || !longrun_driver)
return;
return -EINVAL;
policy->cpu = 0;
cpufreq_verify_within_limits(policy, 0,
longrun_driver->policy[0].max_cpu_freq);
return;
return 0;
}
......@@ -252,20 +252,22 @@ static int __init longrun_init(void)
longrun_get_policy(&driver->policy[0]);
#ifdef CONFIG_CPU_FREQ_24_API
driver->cpu_min_freq = longrun_low_freq;
driver->cpu_min_freq[0] = longrun_low_freq;
driver->cpu_cur_freq[0] = longrun_high_freq; /* dummy value */
#endif
driver->verify = &longrun_verify_policy;
driver->setpolicy = &longrun_set_policy;
longrun_driver = driver;
result = cpufreq_register(driver);
if (result) {
longrun_driver = NULL;
kfree(driver);
return result;
}
longrun_driver = driver;
return 0;
return result;
}
......
......@@ -78,7 +78,7 @@ static int cpufreq_p4_setdc(unsigned int cpu, unsigned int newstate)
}
#endif
set_cpus_allowed(current, affected_cpu_map);
BUG_ON(!(smp_processor_id() & affected_cpu_map));
BUG_ON(!(affected_cpu_map & (1 << smp_processor_id())));
/* get current state */
rdmsr(MSR_IA32_THERM_CONTROL, l, h);
......@@ -136,14 +136,14 @@ static int cpufreq_p4_setdc(unsigned int cpu, unsigned int newstate)
}
static void cpufreq_p4_setpolicy(struct cpufreq_policy *policy)
static int cpufreq_p4_setpolicy(struct cpufreq_policy *policy)
{
unsigned int i;
unsigned int newstate = 0;
unsigned int number_states = 0;
if (!cpufreq_p4_driver || !stock_freq || !policy)
return;
return -EINVAL;
if (policy->policy == CPUFREQ_POLICY_POWERSAVE)
{
......@@ -183,16 +183,17 @@ static void cpufreq_p4_setpolicy(struct cpufreq_policy *policy)
min_state = newstate - (number_states - 1);
}
} */
return 0;
}
static void cpufreq_p4_verify(struct cpufreq_policy *policy)
static int cpufreq_p4_verify(struct cpufreq_policy *policy)
{
unsigned int number_states = 0;
unsigned int i;
if (!cpufreq_p4_driver || !stock_freq || !policy)
return;
return -EINVAL;
if (!cpu_online(policy->cpu))
policy->cpu = CPUFREQ_ALL_CPUS;
......@@ -205,10 +206,10 @@ static void cpufreq_p4_verify(struct cpufreq_policy *policy)
number_states++;
if (number_states)
return;
return 0;
policy->max = (stock_freq / 8) * (((unsigned int) ((policy->max * 8) / stock_freq)) + 1);
return;
return 0;
}
......@@ -255,9 +256,10 @@ int __init cpufreq_p4_init(void)
stock_freq = cpu_khz;
#ifdef CONFIG_CPU_FREQ_24_API
driver->cpu_min_freq = stock_freq / 8;
for (i=0;i<NR_CPUS;i++)
for (i=0;i<NR_CPUS;i++) {
driver->cpu_min_freq[i] = stock_freq / 8;
driver->cpu_cur_freq[i] = stock_freq;
}
#endif
driver->verify = &cpufreq_p4_verify;
......@@ -274,15 +276,15 @@ int __init cpufreq_p4_init(void)
driver->policy[i].cpu = i;
}
cpufreq_p4_driver = driver;
ret = cpufreq_register(driver);
if (ret) {
cpufreq_p4_driver = NULL;
kfree(driver);
return ret;
}
cpufreq_p4_driver = driver;
return 0;
return ret;
}
......
/*
* $Id: powernow-k6.c,v 1.33 2002/09/29 23:43:11 db Exp $
* $Id: powernow-k6.c,v 1.36 2002/10/31 21:17:40 db Exp $
* This file was part of Powertweak Linux (http://powertweak.sf.net)
* and is shared with the Linux Kernel module.
*
......@@ -113,13 +113,13 @@ static void powernow_k6_set_state (unsigned int best_i)
* Policy must be within lowest and highest possible CPU Frequency,
* and at least one possible state must be within min and max.
*/
static void powernow_k6_verify(struct cpufreq_policy *policy)
static int powernow_k6_verify(struct cpufreq_policy *policy)
{
unsigned int number_states = 0;
unsigned int i, j;
if (!policy || !busfreq)
return;
return -EINVAL;
policy->cpu = 0;
cpufreq_verify_within_limits(policy, (20 * busfreq),
......@@ -131,7 +131,7 @@ static void powernow_k6_verify(struct cpufreq_policy *policy)
number_states++;
if (number_states)
return;
return 0;
/* no state is available within range -- find next larger state */
......@@ -144,7 +144,7 @@ static void powernow_k6_verify(struct cpufreq_policy *policy)
policy->max = clock_ratio[j] * busfreq;
return;
return 0;
}
......@@ -154,13 +154,13 @@ static void powernow_k6_verify(struct cpufreq_policy *policy)
*
* sets a new CPUFreq policy
*/
static void powernow_k6_setpolicy (struct cpufreq_policy *policy)
static int powernow_k6_setpolicy (struct cpufreq_policy *policy)
{
unsigned int number_states = 0;
unsigned int i, j=4;
if (!powernow_driver)
return;
return -EINVAL;
for (i=0; i<8; i++)
if ((policy->min <= (busfreq * clock_ratio[i])) &&
......@@ -174,7 +174,7 @@ static void powernow_k6_setpolicy (struct cpufreq_policy *policy)
/* if only one state is within the limit borders, it
is easily detected and set */
powernow_k6_set_state(j);
return;
return 0;
}
/* more than one state within limit */
......@@ -196,14 +196,14 @@ static void powernow_k6_setpolicy (struct cpufreq_policy *policy)
j = i;
break;
default:
return;
return -EINVAL;
}
if (clock_ratio[i] > max_multiplier)
BUG();
return -EINVAL;
powernow_k6_set_state(j);
return;
return 0;
}
......@@ -242,7 +242,7 @@ static int __init powernow_k6_init(void)
driver->policy = (struct cpufreq_policy *) (driver + 1);
#ifdef CONFIG_CPU_FREQ_24_API
driver->cpu_min_freq = busfreq * 20;
driver->cpu_min_freq[0] = busfreq * 20;
driver->cpu_cur_freq[0] = busfreq * max_multiplier;
#endif
......@@ -255,16 +255,16 @@ static int __init powernow_k6_init(void)
driver->policy[0].policy = CPUFREQ_POLICY_PERFORMANCE;
driver->policy[0].max_cpu_freq = busfreq * max_multiplier;
powernow_driver = driver;
result = cpufreq_register(driver);
if (result) {
release_region (POWERNOW_IOPORT, 16);
powernow_driver = NULL;
kfree(driver);
return result;
}
powernow_driver = driver;
return 0;
return result;
}
......
/*
* $Id: speedstep.c,v 1.57 2002/11/05 12:01:12 db Exp $
* $Id: speedstep.c,v 1.58 2002/11/11 15:35:46 db Exp $
*
* (C) 2001 Dave Jones, Arjan van de ven.
* (C) 2002 Dominik Brodowski <linux@brodo.de>
......@@ -567,10 +567,10 @@ static int speedstep_detect_speeds (void)
*
* Sets a new CPUFreq policy.
*/
static void speedstep_setpolicy (struct cpufreq_policy *policy)
static int speedstep_setpolicy (struct cpufreq_policy *policy)
{
if (!speedstep_driver || !policy)
return;
return -EINVAL;
if (policy->min > speedstep_low_freq)
speedstep_set_state(SPEEDSTEP_HIGH, 1);
......@@ -585,6 +585,7 @@ static void speedstep_setpolicy (struct cpufreq_policy *policy)
speedstep_set_state(SPEEDSTEP_HIGH, 1);
}
}
return 0;
}
......@@ -595,11 +596,11 @@ static void speedstep_setpolicy (struct cpufreq_policy *policy)
* Limit must be within speedstep_low_freq and speedstep_high_freq, with
* at least one border included.
*/
static void speedstep_verify (struct cpufreq_policy *policy)
static int speedstep_verify (struct cpufreq_policy *policy)
{
if (!policy || !speedstep_driver ||
!speedstep_low_freq || !speedstep_high_freq)
return;
return -EINVAL;
policy->cpu = 0; /* UP only */
......@@ -609,7 +610,7 @@ static void speedstep_verify (struct cpufreq_policy *policy)
(policy->max < speedstep_high_freq))
policy->max = speedstep_high_freq;
return;
return 0;
}
......@@ -654,12 +655,11 @@ static int __init speedstep_init(void)
speedstep_processor = speedstep_detect_processor();
if ((!speedstep_chipset) || (!speedstep_processor)) {
printk(KERN_INFO "a 0x%x b 0x%x\n", speedstep_processor, speedstep_chipset);
printk(KERN_INFO "cpufreq: Intel(R) SpeedStep(TM) for this %s not (yet) available.\n", speedstep_chipset ? "processor" : "chipset");
return -ENODEV;
}
dprintk(KERN_INFO "cpufreq: Intel(R) SpeedStep(TM) support $Revision: 1.57 $\n");
dprintk(KERN_INFO "cpufreq: Intel(R) SpeedStep(TM) support $Revision: 1.58 $\n");
dprintk(KERN_DEBUG "cpufreq: chipset 0x%x - processor 0x%x\n",
speedstep_chipset, speedstep_processor);
......@@ -693,7 +693,7 @@ static int __init speedstep_init(void)
driver->policy = (struct cpufreq_policy *) (driver + 1);
#ifdef CONFIG_CPU_FREQ_24_API
driver->cpu_min_freq = speedstep_low_freq;
driver->cpu_min_freq[0] = speedstep_low_freq;
driver->cpu_cur_freq[0] = speed;
#endif
......@@ -707,14 +707,15 @@ static int __init speedstep_init(void)
driver->policy[0].policy = (speed == speedstep_low_freq) ?
CPUFREQ_POLICY_POWERSAVE : CPUFREQ_POLICY_PERFORMANCE;
speedstep_driver = driver;
result = cpufreq_register(driver);
if (result) {
speedstep_driver = NULL;
kfree(driver);
return result;
}
speedstep_driver = driver;
return 0;
return result;
}
......
......@@ -1475,11 +1475,8 @@ linux_syscall_trace:
.globl C_LABEL(ret_from_fork)
C_LABEL(ret_from_fork):
#if CONFIG_SMP || CONFIG_PREEMPT
/* XXX Wrong location: call schedule_tail in every ret_sys_call. */
call schedule_tail
mov %g3, %o0
#endif
b C_LABEL(ret_sys_call)
ld [%sp + REGWIN_SZ + PT_I0], %o0
......
......@@ -457,16 +457,20 @@ asmlinkage int sparc_do_fork(unsigned long clone_flags,
struct pt_regs *regs,
unsigned long stack_size)
{
unsigned long tid_ptr = 0;
unsigned long parent_tid_ptr = 0;
unsigned long child_tid_ptr = 0;
struct task_struct *p;
clone_flags &= ~CLONE_IDLETASK;
if (clone_flags & (CLONE_SETTID | CLONE_CLEARTID))
tid_ptr = regs->u_regs[UREG_G2];
if (clone_flags & (CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID)) {
parent_tid_ptr = regs->u_regs[UREG_G2];
child_tid_ptr = regs->u_regs[UREG_G3];
}
p = do_fork(clone_flags, stack_start,
regs, stack_size, (int *) tid_ptr);
regs, stack_size,
(int *) parent_tid_ptr,
(int *) child_tid_ptr);
return IS_ERR(p) ? PTR_ERR(p) : p->pid;
}
......@@ -507,7 +511,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
#endif
}
p->user_tid = NULL;
p->set_child_tid = p->clear_child_tid = NULL;
/* Calculate offset to stack_frame & pt_regs */
stack_offset = THREAD_SIZE - TRACEREG_SZ;
......@@ -582,16 +586,6 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
/* Set the return value for the parent. */
regs->u_regs[UREG_I1] = 0;
if (!(clone_flags & (CLONE_SETTID | CLONE_CLEARTID)))
return 0;
if (clone_flags & CLONE_SETTID)
if (put_user(p->pid, (int *)childregs->u_regs[UREG_G2]))
return -EFAULT;
if (clone_flags & CLONE_CLEARTID)
p->user_tid = (int *) childregs->u_regs[UREG_G2];
return 0;
}
......
......@@ -1619,10 +1619,8 @@ ret_from_syscall:
*/
andn %o7, _TIF_NEWCHILD, %l0
stx %l0, [%g6 + TI_FLAGS]
#if CONFIG_SMP || CONFIG_PREEMPT
call schedule_tail
mov %g5, %o0
#endif
andcc %l0, _TIF_PERFCTR, %g0
be,pt %icc, 1f
nop
......
......@@ -568,18 +568,24 @@ asmlinkage int sparc_do_fork(unsigned long clone_flags,
unsigned long stack_size)
{
struct task_struct *p;
unsigned long tid_ptr = 0;
unsigned long parent_tid_ptr = 0;
unsigned long child_tid_ptr = 0;
clone_flags &= ~CLONE_IDLETASK;
if (clone_flags & (CLONE_SETTID | CLONE_CLEARTID)) {
tid_ptr = regs->u_regs[UREG_G2];
if (test_thread_flag(TIF_32BIT))
tid_ptr &= 0xffffffff;
if (clone_flags & (CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID)) {
parent_tid_ptr = regs->u_regs[UREG_G2];
child_tid_ptr = regs->u_regs[UREG_G3];
if (test_thread_flag(TIF_32BIT)) {
parent_tid_ptr &= 0xffffffff;
child_tid_ptr &= 0xffffffff;
}
}
p = do_fork(clone_flags, stack_start,
regs, stack_size, (int *) tid_ptr);
regs, stack_size,
(int *) parent_tid_ptr,
(int *) child_tid_ptr);
return IS_ERR(p) ? PTR_ERR(p) : p->pid;
}
......@@ -601,7 +607,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
p->thread.smp_lock_pc = 0;
#endif
p->user_tid = NULL;
p->set_child_tid = p->clear_child_tid = NULL;
/* Calculate offset to stack_frame & pt_regs */
child_trap_frame = ((char *)t) + (THREAD_SIZE - (TRACEREG_SZ+REGWIN_SZ));
......
......@@ -1613,7 +1613,7 @@ acpi_processor_get_limit_info (
cpufreq interface
-------------------------------------------------------------------------- */
#ifdef CONFIG_ACPI_PROCESSOR_PERF
static void
static int
acpi_cpufreq_setpolicy (
struct cpufreq_policy *policy)
{
......@@ -1626,7 +1626,7 @@ acpi_cpufreq_setpolicy (
ACPI_FUNCTION_TRACE("acpi_cpufreq_setpolicy");
if (!policy)
return_VOID;
return_VALUE(-EINVAL);
/* get a present, initialized CPU */
if (policy->cpu == CPUFREQ_ALL_CPUS)
......@@ -1644,7 +1644,7 @@ acpi_cpufreq_setpolicy (
cpu = policy->cpu;
pr = processors[cpu];
if (!pr)
return_VOID;
return_VALUE(-EINVAL);
}
/* select appropriate P-State */
......@@ -1686,11 +1686,11 @@ acpi_cpufreq_setpolicy (
result = acpi_processor_set_performance (pr, next_state);
}
return_VOID;
return_VALUE(0);
}
static void
static int
acpi_cpufreq_verify (
struct cpufreq_policy *policy)
{
......@@ -1703,7 +1703,7 @@ acpi_cpufreq_verify (
ACPI_FUNCTION_TRACE("acpi_cpufreq_verify");
if (!policy)
return_VOID;
return_VALUE(-EINVAL);
/* get a present, initialized CPU */
if (policy->cpu == CPUFREQ_ALL_CPUS)
......@@ -1721,7 +1721,7 @@ acpi_cpufreq_verify (
cpu = policy->cpu;
pr = processors[cpu];
if (!pr)
return_VOID;
return_VALUE(-EINVAL);
}
/* first check if min and max are within valid limits */
......@@ -1741,13 +1741,12 @@ acpi_cpufreq_verify (
next_larger_state = i;
}
if (number_states)
return_VOID;
/* round up now */
policy->max = pr->performance.states[next_larger_state].core_frequency * 1000;
if (!number_states) {
/* round up now */
policy->max = pr->performance.states[next_larger_state].core_frequency * 1000;
}
return_VOID;
return_VALUE(0);
}
static int
......@@ -1807,9 +1806,10 @@ acpi_cpufreq_init (
driver->policy = (struct cpufreq_policy *) (driver + 1);
#ifdef CONFIG_CPU_FREQ_24_API
driver->cpu_min_freq = pr->performance.states[pr->performance.state_count - 1].core_frequency * 1000;
for (i=0;i<NR_CPUS;i++)
for (i=0;i<NR_CPUS;i++) {
driver->cpu_cur_freq[0] = pr->performance.states[current_state].core_frequency * 1000;
driver->cpu_min_freq[0] = pr->performance.states[pr->performance.state_count - 1].core_frequency * 1000;
}
#endif
driver->verify = &acpi_cpufreq_verify;
......
This diff is collapsed.
......@@ -77,32 +77,13 @@ obj-$(CONFIG_NWBUTTON) += nwbutton.o
obj-$(CONFIG_NWFLASH) += nwflash.o
obj-$(CONFIG_SCx200_GPIO) += scx200_gpio.o
# Only one watchdog can succeed. We probe the hardware watchdog
# drivers first, then the softdog driver. This means if your hardware
# watchdog dies or is 'borrowed' for some reason the software watchdog
# still gives you some cover.
obj-$(CONFIG_PCWATCHDOG) += pcwd.o
obj-$(CONFIG_ACQUIRE_WDT) += acquirewdt.o
obj-$(CONFIG_ADVANTECH_WDT) += advantechwdt.o
obj-$(CONFIG_IB700_WDT) += ib700wdt.o
obj-$(CONFIG_MIXCOMWD) += mixcomwd.o
obj-$(CONFIG_SCx200_WDT) += scx200_wdt.o
obj-$(CONFIG_60XX_WDT) += sbc60xxwdt.o
obj-$(CONFIG_WDT) += wdt.o
obj-$(CONFIG_WDTPCI) += wdt_pci.o
obj-$(CONFIG_21285_WATCHDOG) += wdt285.o
obj-$(CONFIG_977_WATCHDOG) += wdt977.o
obj-$(CONFIG_I810_TCO) += i810-tco.o
obj-$(CONFIG_MACHZ_WDT) += machzwd.o
obj-$(CONFIG_SH_WDT) += shwdt.o
obj-$(CONFIG_EUROTECH_WDT) += eurotechwdt.o
obj-$(CONFIG_SOFT_WATCHDOG) += softdog.o
obj-$(CONFIG_WATCHDOGS) += watchdog/
obj-$(CONFIG_MWAVE) += mwave/
obj-$(CONFIG_AGP) += agp/
obj-$(CONFIG_DRM) += drm/
obj-$(CONFIG_PCMCIA) += pcmcia/
# Files generated that shall be removed upon make clean
clean-files := consolemap_deftbl.c defkeymap.c qtronixmap.c
......
This diff is collapsed.
/*
* Sony Programmable I/O Control Device driver for VAIO
*
* Copyright (C) 2001 Stelian Pop <stelian.pop@fr.alcove.com>, Alcve
* Copyright (C) 2001-2002 Stelian Pop <stelian@popies.net>
*
* Copyright (C) 2001-2002 Alcve <www.alcove.com>
*
* Copyright (C) 2001 Michael Ashley <m.ashley@unsw.edu.au>
*
......@@ -35,10 +37,16 @@
#ifdef __KERNEL__
#define SONYPI_DRIVER_MAJORVERSION 1
#define SONYPI_DRIVER_MINORVERSION 14
#define SONYPI_DRIVER_MINORVERSION 15
#define SONYPI_DEVICE_MODEL_TYPE1 1
#define SONYPI_DEVICE_MODEL_TYPE2 2
#include <linux/config.h>
#include <linux/types.h>
#include <linux/pci.h>
#include <linux/pm.h>
#include <linux/acpi.h>
#include "linux/sonypi.h"
/* type1 models use those */
......@@ -145,25 +153,23 @@ static struct sonypi_irq_list sonypi_type2_irq_list[] = {
#define SONYPI_CAMERA_REVISION 8
#define SONYPI_CAMERA_ROMVERSION 9
/* key press event data (ioport2) */
#define SONYPI_TYPE1_JOGGER_EV 0x10
#define SONYPI_TYPE2_JOGGER_EV 0x08
#define SONYPI_TYPE1_CAPTURE_EV 0x60
#define SONYPI_TYPE2_CAPTURE_EV 0x08
#define SONYPI_TYPE1_FNKEY_EV 0x20
#define SONYPI_TYPE2_FNKEY_EV 0x08
#define SONYPI_TYPE1_BLUETOOTH_EV 0x30
#define SONYPI_TYPE2_BLUETOOTH_EV 0x08
#define SONYPI_TYPE1_PKEY_EV 0x40
#define SONYPI_TYPE2_PKEY_EV 0x08
#define SONYPI_BACK_EV 0x08
#define SONYPI_LID_EV 0x38
/* Event masks */
#define SONYPI_JOGGER_MASK 0x00000001
#define SONYPI_CAPTURE_MASK 0x00000002
#define SONYPI_FNKEY_MASK 0x00000004
#define SONYPI_BLUETOOTH_MASK 0x00000008
#define SONYPI_PKEY_MASK 0x00000010
#define SONYPI_BACK_MASK 0x00000020
#define SONYPI_HELP_MASK 0x00000040
#define SONYPI_LID_MASK 0x00000080
#define SONYPI_ZOOM_MASK 0x00000100
#define SONYPI_THUMBPHRASE_MASK 0x00000200
#define SONYPI_MEYE_MASK 0x00000400
struct sonypi_event {
u8 data;
u8 event;
};
/* The set of possible jogger events */
static struct sonypi_event sonypi_joggerev[] = {
{ 0x1f, SONYPI_EVENT_JOGDIAL_UP },
......@@ -180,7 +186,7 @@ static struct sonypi_event sonypi_joggerev[] = {
{ 0x43, SONYPI_EVENT_JOGDIAL_VFAST_DOWN_PRESSED },
{ 0x40, SONYPI_EVENT_JOGDIAL_PRESSED },
{ 0x00, SONYPI_EVENT_JOGDIAL_RELEASED },
{ 0x00, 0x00 }
{ 0, 0 }
};
/* The set of possible capture button events */
......@@ -189,7 +195,7 @@ static struct sonypi_event sonypi_captureev[] = {
{ 0x07, SONYPI_EVENT_CAPTURE_PRESSED },
{ 0x01, SONYPI_EVENT_CAPTURE_PARTIALRELEASED },
{ 0x00, SONYPI_EVENT_CAPTURE_RELEASED },
{ 0x00, 0x00 }
{ 0, 0 }
};
/* The set of possible fnkeys events */
......@@ -215,7 +221,7 @@ static struct sonypi_event sonypi_fnkeyev[] = {
{ 0x34, SONYPI_EVENT_FNKEY_S },
{ 0x35, SONYPI_EVENT_FNKEY_B },
{ 0x36, SONYPI_EVENT_FNKEY_ONLY },
{ 0x00, 0x00 }
{ 0, 0 }
};
/* The set of possible program key events */
......@@ -223,7 +229,7 @@ static struct sonypi_event sonypi_pkeyev[] = {
{ 0x01, SONYPI_EVENT_PKEY_P1 },
{ 0x02, SONYPI_EVENT_PKEY_P2 },
{ 0x04, SONYPI_EVENT_PKEY_P3 },
{ 0x00, 0x00 }
{ 0, 0 }
};
/* The set of possible bluetooth events */
......@@ -231,21 +237,74 @@ static struct sonypi_event sonypi_blueev[] = {
{ 0x55, SONYPI_EVENT_BLUETOOTH_PRESSED },
{ 0x59, SONYPI_EVENT_BLUETOOTH_ON },
{ 0x5a, SONYPI_EVENT_BLUETOOTH_OFF },
{ 0x00, 0x00 }
{ 0, 0 }
};
/* The set of possible back button events */
static struct sonypi_event sonypi_backev[] = {
{ 0x20, SONYPI_EVENT_BACK_PRESSED },
{ 0, 0 }
};
/* The set of possible help button events */
static struct sonypi_event sonypi_helpev[] = {
{ 0x3b, SONYPI_EVENT_HELP_PRESSED },
{ 0x00, 0x00 }
{ 0, 0 }
};
/* The set of possible lid events */
static struct sonypi_event sonypi_lidev[] = {
{ 0x51, SONYPI_EVENT_LID_CLOSED },
{ 0x50, SONYPI_EVENT_LID_OPENED },
{ 0x00, 0x00 }
{ 0, 0 }
};
/* The set of possible zoom events */
static struct sonypi_event sonypi_zoomev[] = {
{ 0x3a, SONYPI_EVENT_ZOOM_PRESSED },
{ 0, 0 }
};
/* The set of possible thumbphrase events */
static struct sonypi_event sonypi_thumbphraseev[] = {
{ 0x3a, SONYPI_EVENT_THUMBPHRASE_PRESSED },
{ 0, 0 }
};
/* The set of possible motioneye camera events */
static struct sonypi_event sonypi_meyeev[] = {
{ 0x00, SONYPI_EVENT_MEYE_FACE },
{ 0x01, SONYPI_EVENT_MEYE_OPPOSITE },
{ 0, 0 }
};
struct sonypi_eventtypes {
int model;
u8 data;
unsigned long mask;
struct sonypi_event * events;
} sonypi_eventtypes[] = {
{ SONYPI_DEVICE_MODEL_TYPE1, 0x70, SONYPI_MEYE_MASK, sonypi_meyeev },
{ SONYPI_DEVICE_MODEL_TYPE1, 0x30, SONYPI_LID_MASK, sonypi_lidev },
{ SONYPI_DEVICE_MODEL_TYPE1, 0x60, SONYPI_CAPTURE_MASK, sonypi_captureev },
{ SONYPI_DEVICE_MODEL_TYPE1, 0x10, SONYPI_JOGGER_MASK, sonypi_joggerev },
{ SONYPI_DEVICE_MODEL_TYPE1, 0x20, SONYPI_FNKEY_MASK, sonypi_fnkeyev },
{ SONYPI_DEVICE_MODEL_TYPE1, 0x30, SONYPI_BLUETOOTH_MASK, sonypi_blueev },
{ SONYPI_DEVICE_MODEL_TYPE1, 0x40, SONYPI_PKEY_MASK, sonypi_pkeyev },
{ SONYPI_DEVICE_MODEL_TYPE2, 0x38, SONYPI_LID_MASK, sonypi_lidev },
{ SONYPI_DEVICE_MODEL_TYPE2, 0x08, SONYPI_JOGGER_MASK, sonypi_joggerev },
{ SONYPI_DEVICE_MODEL_TYPE2, 0x08, SONYPI_CAPTURE_MASK, sonypi_captureev },
{ SONYPI_DEVICE_MODEL_TYPE2, 0x08, SONYPI_FNKEY_MASK, sonypi_fnkeyev },
{ SONYPI_DEVICE_MODEL_TYPE2, 0x08, SONYPI_BLUETOOTH_MASK, sonypi_blueev },
{ SONYPI_DEVICE_MODEL_TYPE2, 0x08, SONYPI_PKEY_MASK, sonypi_pkeyev },
{ SONYPI_DEVICE_MODEL_TYPE2, 0x08, SONYPI_BACK_MASK, sonypi_backev },
{ SONYPI_DEVICE_MODEL_TYPE2, 0x08, SONYPI_HELP_MASK, sonypi_helpev },
{ SONYPI_DEVICE_MODEL_TYPE2, 0x08, SONYPI_ZOOM_MASK, sonypi_zoomev },
{ SONYPI_DEVICE_MODEL_TYPE2, 0x08, SONYPI_THUMBPHRASE_MASK, sonypi_thumbphraseev },
{ 0, 0, 0, 0 }
};
#define SONYPI_BUF_SIZE 128
......@@ -259,9 +318,6 @@ struct sonypi_queue {
unsigned char buf[SONYPI_BUF_SIZE];
};
#define SONYPI_DEVICE_MODEL_TYPE1 1
#define SONYPI_DEVICE_MODEL_TYPE2 2
struct sonypi_device {
struct pci_dev *dev;
u16 irq;
......@@ -275,16 +331,47 @@ struct sonypi_device {
struct sonypi_queue queue;
int open_count;
int model;
#if CONFIG_PM
struct pm_dev *pm;
#endif
};
#define wait_on_command(quiet, command) { \
unsigned int n = 10000; \
#define ITERATIONS_LONG 10000
#define ITERATIONS_SHORT 10
#define wait_on_command(quiet, command, iterations) { \
unsigned int n = iterations; \
while (--n && (command)) \
udelay(1); \
if (!n && (verbose || !quiet)) \
printk(KERN_WARNING "sonypi command failed at %s : %s (line %d)\n", __FILE__, __FUNCTION__, __LINE__); \
}
#if !defined(CONFIG_ACPI)
extern int verbose;
static inline int ec_write(u8 addr, u8 value) {
wait_on_command(1, inb_p(SONYPI_CST_IOPORT) & 3, ITERATIONS_LONG);
outb_p(0x81, SONYPI_CST_IOPORT);
wait_on_command(0, inb_p(SONYPI_CST_IOPORT) & 2, ITERATIONS_LONG);
outb_p(addr, SONYPI_DATA_IOPORT);
wait_on_command(0, inb_p(SONYPI_CST_IOPORT) & 2, ITERATIONS_LONG);
outb_p(value, SONYPI_DATA_IOPORT);
wait_on_command(0, inb_p(SONYPI_CST_IOPORT) & 2, ITERATIONS_LONG);
return 0;
}
static inline int ec_read(u8 addr, u8 *value) {
wait_on_command(1, inb_p(SONYPI_CST_IOPORT) & 3, ITERATIONS_LONG);
outb_p(0x80, SONYPI_CST_IOPORT);
wait_on_command(0, inb_p(SONYPI_CST_IOPORT) & 2, ITERATIONS_LONG);
outb_p(addr, SONYPI_DATA_IOPORT);
wait_on_command(0, inb_p(SONYPI_CST_IOPORT) & 2, ITERATIONS_LONG);
*value = inb_p(SONYPI_DATA_IOPORT);
return 0;
}
#endif /* !CONFIG_ACPI */
#endif /* __KERNEL__ */
#endif /* _SONYPI_PRIV_H_ */
This diff is collapsed.
#
# Makefile for the kernel character device drivers.
#
# Only one watchdog can succeed. We probe the hardware watchdog
# drivers first, then the softdog driver. This means if your hardware
# watchdog dies or is 'borrowed' for some reason the software watchdog
# still gives you some cover.
watchdog-$(CONFIG_PCWATCHDOG) += pcwd.o
watchdog-$(CONFIG_ACQUIRE_WDT) += acquirewdt.o
watchdog-$(CONFIG_ADVANTECH_WDT) += advantechwdt.o
watchdog-$(CONFIG_IB700_WDT) += ib700wdt.o
watchdog-$(CONFIG_MIXCOMWD) += mixcomwd.o
watchdog-$(CONFIG_SCx200_WDT) += scx200_wdt.o
watchdog-$(CONFIG_60XX_WDT) += sbc60xxwdt.o
watchdog-$(CONFIG_WDT) += wdt.o
watchdog-$(CONFIG_WDTPCI) += wdt_pci.o
watchdog-$(CONFIG_21285_WATCHDOG) += wdt285.o
watchdog-$(CONFIG_977_WATCHDOG) += wdt977.o
watchdog-$(CONFIG_I810_TCO) += i810-tco.o
watchdog-$(CONFIG_MACHZ_WDT) += machzwd.o
watchdog-$(CONFIG_SH_WDT) += shwdt.o
watchdog-$(CONFIG_EUROTECH_WDT) += eurotechwdt.o
watchdog-$(CONFIG_SOFT_WATCHDOG) += softdog.o
include $(TOPDIR)/Rules.make
......@@ -411,8 +411,8 @@ static int cpci_configure_bridge(struct pci_bus* bus, struct pci_dev* dev)
* Update the bridge resources of the bridge to accommodate devices
* behind it.
*/
pbus_size_bridges(child);
pbus_assign_resources(child);
pci_bus_size_bridges(child);
pci_bus_assign_resources(child);
/* Enable resource mapping via command register */
command = PCI_COMMAND_MASTER | PCI_COMMAND_INVALIDATE | PCI_COMMAND_PARITY | PCI_COMMAND_SERR;
......
This diff is collapsed.
/*
* Motion Eye video4linux driver for Sony Vaio PictureBook
*
* Copyright (C) 2001 Stelian Pop <stelian.pop@fr.alcove.com>, Alcve
* Copyright (C) 2001-2002 Stelian Pop <stelian@popies.net>
*
* Copyright (C) 2001-2002 Alcve <www.alcove.com>
*
* Copyright (C) 2000 Andrew Tridgell <tridge@valinux.com>
*
......@@ -29,7 +31,7 @@
#define _MEYE_PRIV_H_
#define MEYE_DRIVER_MAJORVERSION 1
#define MEYE_DRIVER_MINORVERSION 4
#define MEYE_DRIVER_MINORVERSION 5
/****************************************************************************/
/* Motion JPEG chip registers */
......
......@@ -333,13 +333,13 @@ pbus_size_mem(struct pci_bus *bus, unsigned long mask, unsigned long type)
}
void __devinit
pbus_size_bridges(struct pci_bus *bus)
pci_bus_size_bridges(struct pci_bus *bus)
{
struct list_head *ln;
unsigned long mask, type;
for (ln=bus->children.next; ln != &bus->children; ln=ln->next)
pbus_size_bridges(pci_bus_b(ln));
pci_bus_size_bridges(pci_bus_b(ln));
/* The root bus? */
if (!bus->self)
......@@ -358,10 +358,10 @@ pbus_size_bridges(struct pci_bus *bus)
}
pbus_size_mem(bus, mask, type);
}
EXPORT_SYMBOL(pbus_size_bridges);
EXPORT_SYMBOL(pci_bus_size_bridges);
void __devinit
pbus_assign_resources(struct pci_bus *bus)
pci_bus_assign_resources(struct pci_bus *bus)
{
struct list_head *ln;
int found_vga = pbus_assign_resources_sorted(bus);
......@@ -377,11 +377,11 @@ pbus_assign_resources(struct pci_bus *bus)
for (ln=bus->children.next; ln != &bus->children; ln=ln->next) {
struct pci_bus *b = pci_bus_b(ln);
pbus_assign_resources(b);
pci_bus_assign_resources(b);
pci_setup_bridge(b);
}
}
EXPORT_SYMBOL(pbus_assign_resources);
EXPORT_SYMBOL(pci_bus_assign_resources);
void __init
pci_assign_unassigned_resources(void)
......@@ -392,10 +392,10 @@ pci_assign_unassigned_resources(void)
/* Depth first, calculate sizes and alignments of all
subordinate buses. */
for(ln=pci_root_buses.next; ln != &pci_root_buses; ln=ln->next)
pbus_size_bridges(pci_bus_b(ln));
pci_bus_size_bridges(pci_bus_b(ln));
/* Depth last, allocate resources and update the hardware. */
for(ln=pci_root_buses.next; ln != &pci_root_buses; ln=ln->next)
pbus_assign_resources(pci_bus_b(ln));
pci_bus_assign_resources(pci_bus_b(ln));
pci_for_each_dev(dev) {
pdev_enable_device(dev);
......
......@@ -48,7 +48,7 @@
#include <linux/intermezzo_fs.h>
static kmem_cache_t * presto_dentry_slab;
kmem_cache_t * presto_dentry_slab;
/* called when a cache lookup succeeds */
static int presto_d_revalidate(struct dentry *de, int flag)
......
......@@ -297,11 +297,20 @@ static int flock_to_posix_lock(struct file *filp, struct file_lock *fl,
return -EINVAL;
}
if (((start += l->l_start) < 0) || (l->l_len < 0))
return -EINVAL;
/* POSIX-1996 leaves the case l->l_len < 0 undefined;
POSIX-2001 defines it. */
start += l->l_start;
end = start + l->l_len - 1;
if (l->l_len < 0) {
end = start - 1;
start += l->l_len;
}
if (start < 0)
return -EINVAL;
if (l->l_len > 0 && end < 0)
return -EOVERFLOW;
fl->fl_start = start; /* we record the absolute position */
fl->fl_end = end;
if (l->l_len == 0)
......
......@@ -65,11 +65,6 @@ nfs4_setup_compound(struct nfs4_compound *cp, struct nfs4_op *ops,
memset(cp, 0, sizeof(*cp));
cp->ops = ops;
cp->server = server;
#if NFS4_DEBUG
cp->taglen = strlen(tag);
cp->tag = tag;
#endif
}
static void
......@@ -373,6 +368,7 @@ nfs4_setup_open(struct nfs4_compound *cp, int flags, struct qstr *name,
BUG_ON(cp->flags);
open->op_client_state = cp->server->nfs4_state;
open->op_share_access = flags & 3;
open->op_opentype = (flags & O_CREAT) ? NFS4_OPEN_CREATE : NFS4_OPEN_NOCREATE;
open->op_createmode = NFS4_CREATE_UNCHECKED;
......@@ -527,6 +523,10 @@ nfs4_setup_rename(struct nfs4_compound *cp, struct qstr *old, struct qstr *new,
static void
nfs4_setup_renew(struct nfs4_compound *cp)
{
struct nfs4_client **client_state = GET_OP(cp, renew);
*client_state = cp->server->nfs4_state;
OPNUM(cp) = OP_RENEW;
cp->req_nops++;
cp->renew_index = cp->req_nops;
......@@ -575,6 +575,7 @@ nfs4_setup_setclientid(struct nfs4_compound *cp, u32 program, unsigned short por
sprintf(setclientid->sc_uaddr, "%s.%d.%d", server->ip_addr, port >> 8, port & 255);
setclientid->sc_prog = program;
setclientid->sc_cb_ident = 0;
setclientid->sc_state = server->nfs4_state;
OPNUM(cp) = OP_SETCLIENTID;
cp->req_nops++;
......@@ -583,6 +584,10 @@ nfs4_setup_setclientid(struct nfs4_compound *cp, u32 program, unsigned short por
static void
nfs4_setup_setclientid_confirm(struct nfs4_compound *cp)
{
struct nfs4_client **client_state = GET_OP(cp, setclientid_confirm);
*client_state = cp->server->nfs4_state;
OPNUM(cp) = OP_SETCLIENTID_CONFIRM;
cp->req_nops++;
cp->renew_index = cp->req_nops;
......
This diff is collapsed.
......@@ -5,7 +5,7 @@
* (C) 2002 Dominik Brodowski <linux@brodo.de>
*
*
* $Id: cpufreq.h,v 1.27 2002/10/08 14:54:23 db Exp $
* $Id: cpufreq.h,v 1.29 2002/11/11 15:35:47 db Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
......@@ -104,7 +104,7 @@ static inline unsigned long cpufreq_scale(unsigned long old, u_int div, u_int mu
* CPUFREQ DRIVER INTERFACE *
*********************************************************************/
typedef void (*cpufreq_policy_t) (struct cpufreq_policy *policy);
typedef int (*cpufreq_policy_t) (struct cpufreq_policy *policy);
struct cpufreq_driver {
/* needed by all drivers */
......@@ -116,7 +116,7 @@ struct cpufreq_driver {
#endif
/* 2.4. compatible API */
#ifdef CONFIG_CPU_FREQ_24_API
unsigned int cpu_min_freq;
unsigned int cpu_min_freq[NR_CPUS];
unsigned int cpu_cur_freq[NR_CPUS];
#endif
};
......@@ -205,19 +205,19 @@ enum {
CPU_NR_FREQ = 3,
};
#define CTL_CPU_VARS_SPEED_MAX { \
#define CTL_CPU_VARS_SPEED_MAX(cpunr) { \
.ctl_name = CPU_NR_FREQ_MAX, \
.data = &cpu_max_freq, \
.data = &cpu_max_freq[cpunr], \
.procname = "speed-max", \
.maxlen = sizeof(cpu_max_freq),\
.maxlen = sizeof(cpu_max_freq[cpunr]),\
.mode = 0444, \
.proc_handler = proc_dointvec, }
#define CTL_CPU_VARS_SPEED_MIN { \
#define CTL_CPU_VARS_SPEED_MIN(cpunr) { \
.ctl_name = CPU_NR_FREQ_MIN, \
.data = &cpu_min_freq, \
.data = &cpu_min_freq[cpunr], \
.procname = "speed-min", \
.maxlen = sizeof(cpu_min_freq),\
.maxlen = sizeof(cpu_min_freq[cpunr]),\
.mode = 0444, \
.proc_handler = proc_dointvec, }
......@@ -230,8 +230,8 @@ enum {
.extra1 = (void*) (cpunr), }
#define CTL_TABLE_CPU_VARS(cpunr) static ctl_table ctl_cpu_vars_##cpunr[] = {\
CTL_CPU_VARS_SPEED_MAX, \
CTL_CPU_VARS_SPEED_MIN, \
CTL_CPU_VARS_SPEED_MAX(cpunr), \
CTL_CPU_VARS_SPEED_MIN(cpunr), \
CTL_CPU_VARS_SPEED(cpunr), \
{ .ctl_name = 0, }, }
......
......@@ -3,11 +3,13 @@
#define _LINUX_INTERRUPT_H
#include <linux/config.h>
#include <linux/linkage.h>
#include <linux/bitops.h>
#include <asm/atomic.h>
#include <asm/hardirq.h>
#include <asm/ptrace.h>
#include <asm/softirq.h>
#include <asm/system.h>
struct irqaction {
void (*handler)(int, void *, struct pt_regs *);
......
/*
* Motion Eye video4linux driver for Sony Vaio PictureBook
*
* Copyright (C) 2001 Stelian Pop <stelian.pop@fr.alcove.com>, Alcve
* Copyright (C) 2001-2002 Stelian Pop <stelian@popies.net>
*
* Copyright (C) 2001-2002 Alcve <www.alcove.com>
*
* Copyright (C) 2000 Andrew Tridgell <tridge@valinux.com>
*
......
......@@ -6,7 +6,9 @@
#include <linux/config.h>
#include <linux/netfilter.h>
#if defined(__KERNEL__) && defined(CONFIG_NETFILTER)
#include <asm/atomic.h>
#endif
/* Bridge Hooks */
/* After promisc drops, checksum checks. */
......@@ -23,6 +25,8 @@
#define NF_BR_BROUTING 5
#define NF_BR_NUMHOOKS 6
#ifdef __KERNEL__
#define BRNF_PKT_TYPE 0x01
#define BRNF_BRIDGED_DNAT 0x02
#define BRNF_DONT_TAKE_PARENT 0x04
......@@ -38,6 +42,7 @@ enum nf_br_hook_priorities {
NF_BR_PRI_LAST = INT_MAX,
};
#ifdef CONFIG_NETFILTER
static inline
struct nf_bridge_info *nf_bridge_alloc(struct sk_buff *skb)
{
......@@ -57,5 +62,7 @@ struct bridge_skb_cb {
__u32 ipv4;
} daddr;
};
#endif /* CONFIG_NETFILTER */
#endif /* __KERNEL__ */
#endif
......@@ -398,6 +398,7 @@ struct nfs4_lookup {
};
struct nfs4_open {
struct nfs4_client * op_client_state; /* request */
u32 op_share_access; /* request */
u32 op_opentype; /* request */
u32 op_createmode; /* request */
......@@ -472,6 +473,7 @@ struct nfs4_setclientid {
char sc_netid[4]; /* request */
char sc_uaddr[24]; /* request */
u32 sc_cb_ident; /* request */
struct nfs4_client * sc_state; /* response */
};
struct nfs4_write {
......@@ -504,8 +506,10 @@ struct nfs4_op {
struct nfs4_readlink readlink;
struct nfs4_remove remove;
struct nfs4_rename rename;
struct nfs4_client * renew;
struct nfs4_setattr setattr;
struct nfs4_setclientid setclientid;
struct nfs4_client * setclientid_confirm;
struct nfs4_write write;
} u;
};
......
......@@ -601,8 +601,8 @@ int pci_enable_wake(struct pci_dev *dev, u32 state, int enable);
/* Helper functions for low-level code (drivers/pci/setup-[bus,res].c) */
void pbus_assign_resources(struct pci_bus *bus);
void pbus_size_bridges(struct pci_bus *bus);
void pci_bus_assign_resources(struct pci_bus *bus);
void pci_bus_size_bridges(struct pci_bus *bus);
int pci_claim_resource(struct pci_dev *, int);
void pci_assign_unassigned_resources(void);
void pdev_enable_device(struct pci_dev *);
......
/*
* Sony Programmable I/O Control Device driver for VAIO
*
* Copyright (C) 2001 Stelian Pop <stelian.pop@fr.alcove.com>, Alcve
* Copyright (C) 2001-2002 Stelian Pop <stelian@popies.net>
*
* Copyright (C) 2001-2002 Alcve <www.alcove.com>
*
* Copyright (C) 2001 Michael Ashley <m.ashley@unsw.edu.au>
*
......@@ -85,6 +87,10 @@
#define SONYPI_EVENT_JOGDIAL_VFAST_UP 47
#define SONYPI_EVENT_JOGDIAL_VFAST_DOWN_PRESSED 48
#define SONYPI_EVENT_JOGDIAL_VFAST_UP_PRESSED 49
#define SONYPI_EVENT_ZOOM_PRESSED 50
#define SONYPI_EVENT_THUMBPHRASE_PRESSED 51
#define SONYPI_EVENT_MEYE_FACE 52
#define SONYPI_EVENT_MEYE_OPPOSITE 53
/* get/set brightness */
#define SONYPI_IOCGBRT _IOR('v', 0, __u8)
......
......@@ -155,6 +155,93 @@ typedef size_t (*skb_read_actor_t)(skb_reader_t *desc, void *to, size_t len);
extern void xdr_partial_copy_from_skb(struct xdr_buf *, unsigned int,
skb_reader_t *, skb_read_actor_t);
/*
* Provide some simple tools for XDR buffer overflow-checking etc.
*/
struct xdr_stream {
uint32_t *p; /* start of available buffer */
struct xdr_buf *buf; /* XDR buffer to read/write */
uint32_t *end; /* end of available buffer space */
struct iovec *iov; /* pointer to the current iovec */
};
/*
* Initialize an xdr_stream for encoding data.
*
* Note: at the moment the RPC client only passes the length of our
* scratch buffer in the xdr_buf's header iovec. Previously this
* meant we needed to call xdr_adjust_iovec() after encoding the
* data. With the new scheme, the xdr_stream manages the details
* of the buffer length, and takes care of adjusting the iovec
* length for us.
*/
static inline void
xdr_init_encode(struct xdr_stream *xdr, struct xdr_buf *buf, uint32_t *p)
{
struct iovec *iov = buf->head;
xdr->buf = buf;
xdr->iov = iov;
xdr->end = (uint32_t *)((char *)iov->iov_base + iov->iov_len);
buf->len = iov->iov_len = (char *)p - (char *)iov->iov_base;
xdr->p = p;
}
/*
* Check that we have enough buffer space to encode 'nbytes' more
* bytes of data. If so, update the total xdr_buf length, and
* adjust the length of the current iovec.
*/
static inline uint32_t *
xdr_reserve_space(struct xdr_stream *xdr, size_t nbytes)
{
uint32_t *p = xdr->p;
uint32_t *q;
/* align nbytes on the next 32-bit boundary */
nbytes += 3;
nbytes &= ~3;
q = p + (nbytes >> 2);
if (unlikely(q > xdr->end || q < p))
return NULL;
xdr->p = q;
xdr->iov->iov_len += nbytes;
xdr->buf->len += nbytes;
return p;
}
/*
* Initialize an xdr_stream for decoding data.
*/
static inline void
xdr_init_decode(struct xdr_stream *xdr, struct xdr_buf *buf, uint32_t *p)
{
struct iovec *iov = buf->head;
xdr->buf = buf;
xdr->iov = iov;
xdr->p = p;
xdr->end = (uint32_t *)((char *)iov->iov_base + iov->iov_len);
}
/*
* Check if the input buffer is long enough to enable us to decode
* 'nbytes' more bytes of data starting at the current position.
* If so return the current pointer, then update the current
* position.
*/
static inline uint32_t *
xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes)
{
uint32_t *p = xdr->p;
uint32_t *q = p + XDR_QUADLEN(nbytes);
if (unlikely(q > xdr->end || q < p))
return NULL;
xdr->p = q;
return p;
}
#endif /* __KERNEL__ */
#endif /* _SUNRPC_XDR_H_ */
......@@ -4,7 +4,7 @@
* Copyright (C) 2001 Russell King
* (C) 2002 Dominik Brodowski <linux@brodo.de>
*
* $Id: cpufreq.c,v 1.45 2002/10/08 14:54:23 db Exp $
* $Id: cpufreq.c,v 1.50 2002/11/11 15:35:48 db Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
......@@ -69,8 +69,8 @@ static struct cpufreq_policy default_policy = {
/**
* A few values needed by the 2.4.-compatible API
*/
static unsigned int cpu_max_freq;
static unsigned int cpu_min_freq;
static unsigned int cpu_max_freq[NR_CPUS];
static unsigned int cpu_min_freq[NR_CPUS];
static unsigned int cpu_cur_freq[NR_CPUS];
#endif
......@@ -228,6 +228,10 @@ static int cpufreq_proc_read (
continue;
cpufreq_get_policy(&policy, i);
if (!policy.max_cpu_freq)
continue;
min_pctg = (policy.min * 100) / policy.max_cpu_freq;
max_pctg = (policy.max * 100) / policy.max_cpu_freq;
......@@ -378,7 +382,7 @@ int cpufreq_setmax(unsigned int cpu)
{
if (!cpu_online(cpu) && (cpu != CPUFREQ_ALL_CPUS))
return -EINVAL;
return cpufreq_set(cpu_max_freq, cpu);
return cpufreq_set(cpu_max_freq[cpu], cpu);
}
EXPORT_SYMBOL_GPL(cpufreq_setmax);
......@@ -807,13 +811,14 @@ int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu)
policy->min = cpufreq_driver->policy[cpu].min;
policy->max = cpufreq_driver->policy[cpu].max;
policy->policy = cpufreq_driver->policy[cpu].policy;
policy->max_cpu_freq = cpufreq_driver->policy[0].max_cpu_freq;
policy->max_cpu_freq = cpufreq_driver->policy[cpu].max_cpu_freq;
policy->cpu = cpu;
up(&cpufreq_driver_sem);
return 0;
}
EXPORT_SYMBOL(cpufreq_get_policy);
/**
......@@ -825,6 +830,7 @@ int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu)
int cpufreq_set_policy(struct cpufreq_policy *policy)
{
unsigned int i;
int ret;
down(&cpufreq_driver_sem);
if (!cpufreq_driver || !cpufreq_driver->verify ||
......@@ -834,12 +840,20 @@ int cpufreq_set_policy(struct cpufreq_policy *policy)
return -EINVAL;
}
down(&cpufreq_notifier_sem);
if (policy->cpu == CPUFREQ_ALL_CPUS)
policy->max_cpu_freq = cpufreq_driver->policy[0].max_cpu_freq;
else
policy->max_cpu_freq = cpufreq_driver->policy[policy->cpu].max_cpu_freq;
policy->max_cpu_freq = cpufreq_driver->policy[0].max_cpu_freq;
/* verify the cpu speed can be set within this limit */
cpufreq_driver->verify(policy);
ret = cpufreq_driver->verify(policy);
if (ret) {
up(&cpufreq_driver_sem);
return ret;
}
down(&cpufreq_notifier_sem);
/* adjust if neccessary - all reasons */
notifier_call_chain(&cpufreq_policy_notifier_list, CPUFREQ_ADJUST,
......@@ -851,7 +865,12 @@ int cpufreq_set_policy(struct cpufreq_policy *policy)
/* verify the cpu speed can be set within this limit,
which might be different to the first one */
cpufreq_driver->verify(policy);
ret = cpufreq_driver->verify(policy);
if (ret) {
up(&cpufreq_notifier_sem);
up(&cpufreq_driver_sem);
return ret;
}
/* notification of the new policy */
notifier_call_chain(&cpufreq_policy_notifier_list, CPUFREQ_NOTIFY,
......@@ -879,11 +898,11 @@ int cpufreq_set_policy(struct cpufreq_policy *policy)
cpu_cur_freq[policy->cpu] = policy->max;
#endif
cpufreq_driver->setpolicy(policy);
ret = cpufreq_driver->setpolicy(policy);
up(&cpufreq_driver_sem);
return 0;
return ret;
}
EXPORT_SYMBOL(cpufreq_set_policy);
......@@ -968,6 +987,8 @@ EXPORT_SYMBOL_GPL(cpufreq_notify_transition);
int cpufreq_register(struct cpufreq_driver *driver_data)
{
unsigned int ret;
unsigned int i;
struct cpufreq_policy policy;
if (cpufreq_driver)
return -EBUSY;
......@@ -979,41 +1000,55 @@ int cpufreq_register(struct cpufreq_driver *driver_data)
down(&cpufreq_driver_sem);
cpufreq_driver = driver_data;
if (!default_policy.policy)
default_policy.policy = driver_data->policy[0].policy;
if (!default_policy.min)
default_policy.min = driver_data->policy[0].min;
if (!default_policy.max)
default_policy.max = driver_data->policy[0].max;
default_policy.cpu = CPUFREQ_ALL_CPUS;
/* check for a default policy - if it exists, use it on _all_ CPUs*/
for (i=0; i<NR_CPUS; i++)
{
if (default_policy.policy)
cpufreq_driver->policy[i].policy = default_policy.policy;
if (default_policy.min)
cpufreq_driver->policy[i].min = default_policy.min;
if (default_policy.max)
cpufreq_driver->policy[i].max = default_policy.max;
}
up(&cpufreq_driver_sem);
/* set default policy on all CPUs. Must be called per-CPU and not
* with CPUFREQ_ALL_CPUs as there might be no common policy for all
* CPUs (UltraSPARC etc.)
*/
for (i=0; i<NR_CPUS; i++)
{
policy.policy = cpufreq_driver->policy[i].policy;
policy.min = cpufreq_driver->policy[i].min;
policy.max = cpufreq_driver->policy[i].max;
policy.cpu = i;
up(&cpufreq_driver_sem);
ret = cpufreq_set_policy(&policy);
down(&cpufreq_driver_sem);
if (ret) {
cpufreq_driver = NULL;
up(&cpufreq_driver_sem);
return ret;
}
}
ret = cpufreq_set_policy(&default_policy);
up(&cpufreq_driver_sem);
cpufreq_proc_init();
#ifdef CONFIG_CPU_FREQ_24_API
down(&cpufreq_driver_sem);
cpu_min_freq = driver_data->cpu_min_freq;
cpu_max_freq = driver_data->policy[0].max_cpu_freq;
down(&cpufreq_driver_sem);
for (i=0; i<NR_CPUS; i++)
{
unsigned int i;
for (i=0; i<NR_CPUS; i++) {
cpu_cur_freq[i] = driver_data->cpu_cur_freq[i];
}
cpu_min_freq[i] = driver_data->cpu_min_freq[i];
cpu_max_freq[i] = driver_data->policy[i].max_cpu_freq;
cpu_cur_freq[i] = driver_data->cpu_cur_freq[i];
}
up(&cpufreq_driver_sem);
cpufreq_sysctl_init();
#endif
if (ret) {
down(&cpufreq_driver_sem);
cpufreq_driver = NULL;
up(&cpufreq_driver_sem);
}
return ret;
return 0;
}
EXPORT_SYMBOL_GPL(cpufreq_register);
......@@ -1061,6 +1096,7 @@ int cpufreq_restore(void)
{
struct cpufreq_policy policy;
unsigned int i;
unsigned int ret = 0;
if (in_interrupt())
panic("cpufreq_restore() called from interrupt context!");
......@@ -1081,10 +1117,10 @@ int cpufreq_restore(void)
policy.cpu = i;
up(&cpufreq_driver_sem);
cpufreq_set_policy(&policy);
ret += cpufreq_set_policy(&policy);
}
return 0;
return ret;
}
EXPORT_SYMBOL_GPL(cpufreq_restore);
#else
......
......@@ -182,9 +182,10 @@ static inline int ip6_input_finish(struct sk_buff *skb)
if (!raw_sk) {
IP6_INC_STATS_BH(Ip6InUnknownProtos);
icmpv6_param_prob(skb, ICMPV6_UNK_NEXTHDR, nhoff);
} else
} else {
IP6_INC_STATS_BH(Ip6InDelivers);
kfree_skb(skb);
kfree_skb(skb);
}
}
return 0;
......
......@@ -116,6 +116,7 @@ EXPORT_SYMBOL(sock_sendmsg);
EXPORT_SYMBOL(sock_recvmsg);
EXPORT_SYMBOL(sk_alloc);
EXPORT_SYMBOL(sk_free);
EXPORT_SYMBOL(sk_send_sigurg);
EXPORT_SYMBOL(sock_wake_async);
EXPORT_SYMBOL(sock_alloc_send_skb);
EXPORT_SYMBOL(sock_alloc_send_pskb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment