Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 336759
b: refs/heads/master
c: ad063fb
h: refs/heads/master
i:
  336757: 3d1987f
  336755: d5ae0e5
  336751: b6d00b6
v: v3
  • Loading branch information
Rafael J. Wysocki committed Nov 29, 2012
1 parent 8edaeb9 commit 6bbe9b3
Show file tree
Hide file tree
Showing 206 changed files with 7,793 additions and 2,700 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8d219e3658c092731cbebe5ab62f15480a815683
refs/heads/master: ad063fbbdda6247c4653b708bf011986e8ab7ec8
31 changes: 31 additions & 0 deletions trunk/Documentation/ABI/testing/sysfs-devices-power
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,34 @@ Description:

This attribute has no effect on system-wide suspend/resume and
hibernation.

What: /sys/devices/.../power/pm_qos_no_power_off
Date: September 2012
Contact: Rafael J. Wysocki <rjw@sisk.pl>
Description:
The /sys/devices/.../power/pm_qos_no_power_off attribute
is used for manipulating the PM QoS "no power off" flag. If
set, this flag indicates to the kernel that power should not
be removed entirely from the device.

Not all drivers support this attribute. If it isn't supported,
it is not present.

This attribute has no effect on system-wide suspend/resume and
hibernation.

What: /sys/devices/.../power/pm_qos_remote_wakeup
Date: September 2012
Contact: Rafael J. Wysocki <rjw@sisk.pl>
Description:
The /sys/devices/.../power/pm_qos_remote_wakeup attribute
is used for manipulating the PM QoS "remote wakeup required"
flag. If set, this flag indicates to the kernel that the
device is a source of user events that have to be signaled from
its low-power states.

Not all drivers support this attribute. If it isn't supported,
it is not present.

This attribute has no effect on system-wide suspend/resume and
hibernation.
14 changes: 14 additions & 0 deletions trunk/Documentation/ABI/testing/sysfs-devices-sun
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Whatt: /sys/devices/.../sun
Date: October 2012
Contact: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Description:
The file contains a Slot-unique ID which provided by the _SUN
method in the ACPI namespace. The value is written in Advanced
Configuration and Power Interface Specification as follows:

"The _SUN value is required to be unique among the slots of
the same type. It is also recommended that this number match
the slot number printed on the physical slot whenever possible."

So reading the sysfs file, we can identify a physical position
of the slot in the system.
42 changes: 42 additions & 0 deletions trunk/Documentation/devicetree/bindings/cpufreq/cpufreq-spear.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
SPEAr cpufreq driver
-------------------

SPEAr SoC cpufreq driver for CPU frequency scaling.
It supports both uniprocessor (UP) and symmetric multiprocessor (SMP) systems
which share clock across all CPUs.

Required properties:
- cpufreq_tbl: Table of frequencies CPU could be transitioned into, in the
increasing order.

Optional properties:
- clock-latency: Specify the possible maximum transition latency for clock, in
unit of nanoseconds.

Both required and optional properties listed above must be defined under node
/cpus/cpu@0.

Examples:
--------
cpus {

<...>

cpu@0 {
compatible = "arm,cortex-a9";
reg = <0>;

<...>

cpufreq_tbl = < 166000
200000
250000
300000
400000
500000
600000 >;
};

<...>

};
2 changes: 1 addition & 1 deletion trunk/Documentation/power/pm_qos_interface.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ reading the aggregated value does not require any locking mechanism.

From kernel mode the use of this interface is the following:

int dev_pm_qos_add_request(device, handle, value):
int dev_pm_qos_add_request(device, handle, type, value):
Will insert an element into the list for that identified device with the
target value. Upon change to this list the new target is recomputed and any
registered notifiers are called only if the target value is now different.
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,7 @@ config ARCH_NOMADIK

config PLAT_SPEAR
bool "ST SPEAr"
select ARCH_HAS_CPUFREQ
select ARCH_REQUIRE_GPIOLIB
select ARM_AMBA
select CLKDEV_LOOKUP
Expand Down
3 changes: 0 additions & 3 deletions trunk/arch/ia64/include/asm/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
#define _ASM_IA64_DEVICE_H

struct dev_archdata {
#ifdef CONFIG_ACPI
void *acpi_handle;
#endif
#ifdef CONFIG_INTEL_IOMMU
void *iommu; /* hook for IOMMU specific extension */
#endif
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/ia64/kernel/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,7 @@ int acpi_register_gsi(struct device *dev, u32 gsi, int triggering, int polarity)
ACPI_EDGE_SENSITIVE) ? IOSAPIC_EDGE :
IOSAPIC_LEVEL);
}
EXPORT_SYMBOL_GPL(acpi_register_gsi);

void acpi_unregister_gsi(u32 gsi)
{
Expand All @@ -644,6 +645,7 @@ void acpi_unregister_gsi(u32 gsi)

iosapic_unregister_intr(gsi);
}
EXPORT_SYMBOL_GPL(acpi_unregister_gsi);

static int __init acpi_parse_fadt(struct acpi_table_header *table)
{
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/powerpc/platforms/pseries/processor_idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ static struct cpuidle_state *cpuidle_state_table;
static inline void idle_loop_prolog(unsigned long *in_purr, ktime_t *kt_before)
{

*kt_before = ktime_get_real();
*kt_before = ktime_get();
*in_purr = mfspr(SPRN_PURR);
/*
* Indicate to the HV that we are idle. Now would be
Expand All @@ -50,7 +50,7 @@ static inline s64 idle_loop_epilog(unsigned long in_purr, ktime_t kt_before)
get_lppaca()->wait_state_cycles += mfspr(SPRN_PURR) - in_purr;
get_lppaca()->idle = 0;

return ktime_to_us(ktime_sub(ktime_get_real(), kt_before));
return ktime_to_us(ktime_sub(ktime_get(), kt_before));
}

static int snooze_loop(struct cpuidle_device *dev,
Expand Down
3 changes: 0 additions & 3 deletions trunk/arch/x86/include/asm/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
#define _ASM_X86_DEVICE_H

struct dev_archdata {
#ifdef CONFIG_ACPI
void *acpi_handle;
#endif
#ifdef CONFIG_X86_DEV_DMA_OPS
struct dma_map_ops *dma_ops;
#endif
Expand Down
6 changes: 6 additions & 0 deletions trunk/arch/x86/kernel/acpi/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,12 @@ int acpi_register_gsi(struct device *dev, u32 gsi, int trigger, int polarity)

return irq;
}
EXPORT_SYMBOL_GPL(acpi_register_gsi);

void acpi_unregister_gsi(u32 gsi)
{
}
EXPORT_SYMBOL_GPL(acpi_unregister_gsi);

void __init acpi_set_irq_model_pic(void)
{
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/x86/kernel/acpi/sleep.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ static int __init acpi_sleep_setup(char *str)
#endif
if (strncmp(str, "nonvs", 5) == 0)
acpi_nvs_nosave();
if (strncmp(str, "nonvs_s3", 8) == 0)
acpi_nvs_nosave_s3();
if (strncmp(str, "old_ordering", 12) == 0)
acpi_old_suspend_ordering();
str = strchr(str, ',');
Expand Down
6 changes: 6 additions & 0 deletions trunk/drivers/acpi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@ config ACPI_DOCK
This driver supports ACPI-controlled docking stations and removable
drive bays such as the IBM Ultrabay and the Dell Module Bay.

config ACPI_I2C
def_tristate I2C
depends on I2C
help
ACPI I2C enumeration support.

config ACPI_PROCESSOR
tristate "Processor"
select THERMAL
Expand Down
6 changes: 5 additions & 1 deletion trunk/drivers/acpi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ obj-y += acpi.o \
acpi-y += osl.o utils.o reboot.o
acpi-y += nvs.o

# sleep related files
# Power management related files
acpi-y += wakeup.o
acpi-y += sleep.o
acpi-$(CONFIG_PM) += device_pm.o
acpi-$(CONFIG_ACPI_SLEEP) += proc.o


Expand All @@ -32,10 +33,12 @@ acpi-$(CONFIG_ACPI_SLEEP) += proc.o
#
acpi-y += bus.o glue.o
acpi-y += scan.o
acpi-y += resource.o
acpi-y += processor_core.o
acpi-y += ec.o
acpi-$(CONFIG_ACPI_DOCK) += dock.o
acpi-y += pci_root.o pci_link.o pci_irq.o pci_bind.o
acpi-y += acpi_platform.o
acpi-y += power.o
acpi-y += event.o
acpi-y += sysfs.o
Expand Down Expand Up @@ -67,6 +70,7 @@ obj-$(CONFIG_ACPI_HED) += hed.o
obj-$(CONFIG_ACPI_EC_DEBUGFS) += ec_sys.o
obj-$(CONFIG_ACPI_CUSTOM_METHOD)+= custom_method.o
obj-$(CONFIG_ACPI_BGRT) += bgrt.o
obj-$(CONFIG_ACPI_I2C) += acpi_i2c.o

# processor has its own "processor." module_param namespace
processor-y := processor_driver.o processor_throttling.o
Expand Down
103 changes: 103 additions & 0 deletions trunk/drivers/acpi/acpi_i2c.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
/*
* ACPI I2C enumeration support
*
* Copyright (C) 2012, Intel Corporation
* Author: Mika Westerberg <mika.westerberg@linux.intel.com>
*
* 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
* published by the Free Software Foundation.
*/

#include <linux/acpi.h>
#include <linux/device.h>
#include <linux/export.h>
#include <linux/i2c.h>
#include <linux/ioport.h>

ACPI_MODULE_NAME("i2c");

static int acpi_i2c_add_resource(struct acpi_resource *ares, void *data)
{
struct i2c_board_info *info = data;

if (ares->type == ACPI_RESOURCE_TYPE_SERIAL_BUS) {
struct acpi_resource_i2c_serialbus *sb;

sb = &ares->data.i2c_serial_bus;
if (sb->type == ACPI_RESOURCE_SERIAL_TYPE_I2C) {
info->addr = sb->slave_address;
if (sb->access_mode == ACPI_I2C_10BIT_MODE)
info->flags |= I2C_CLIENT_TEN;
}
} else if (info->irq < 0) {
struct resource r;

if (acpi_dev_resource_interrupt(ares, 0, &r))
info->irq = r.start;
}

/* Tell the ACPI core to skip this resource */
return 1;
}

static acpi_status acpi_i2c_add_device(acpi_handle handle, u32 level,
void *data, void **return_value)
{
struct i2c_adapter *adapter = data;
struct list_head resource_list;
struct i2c_board_info info;
struct acpi_device *adev;
int ret;

if (acpi_bus_get_device(handle, &adev))
return AE_OK;
if (acpi_bus_get_status(adev) || !adev->status.present)
return AE_OK;

memset(&info, 0, sizeof(info));
info.acpi_node.handle = handle;
info.irq = -1;

INIT_LIST_HEAD(&resource_list);
ret = acpi_dev_get_resources(adev, &resource_list,
acpi_i2c_add_resource, &info);
acpi_dev_free_resource_list(&resource_list);

if (ret < 0 || !info.addr)
return AE_OK;

strlcpy(info.type, dev_name(&adev->dev), sizeof(info.type));
if (!i2c_new_device(adapter, &info)) {
dev_err(&adapter->dev,
"failed to add I2C device %s from ACPI\n",
dev_name(&adev->dev));
}

return AE_OK;
}

/**
* acpi_i2c_register_devices - enumerate I2C slave devices behind adapter
* @adapter: pointer to adapter
*
* Enumerate all I2C slave devices behind this adapter by walking the ACPI
* namespace. When a device is found it will be added to the Linux device
* model and bound to the corresponding ACPI handle.
*/
void acpi_i2c_register_devices(struct i2c_adapter *adapter)
{
acpi_handle handle;
acpi_status status;

handle = ACPI_HANDLE(&adapter->dev);
if (!handle)
return;

status = acpi_walk_namespace(ACPI_TYPE_DEVICE, handle, 1,
acpi_i2c_add_device, NULL,
adapter, NULL);
if (ACPI_FAILURE(status))
dev_warn(&adapter->dev, "failed to enumerate I2C slaves\n");
}
EXPORT_SYMBOL_GPL(acpi_i2c_register_devices);
Loading

0 comments on commit 6bbe9b3

Please sign in to comment.