drivers/acpi/x86/lpss.c
Source file repositories/reference/linux-study-clean/drivers/acpi/x86/lpss.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/acpi/x86/lpss.c- Extension
.c- Size
- 36232 bytes
- Lines
- 1353
- Domain
- Driver Families
- Bucket
- drivers/acpi
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/acpi.hlinux/clkdev.hlinux/clk-provider.hlinux/dmi.hlinux/err.hlinux/io.hlinux/mutex.hlinux/pci.hlinux/platform_device.hlinux/platform_data/x86/clk-lpss.hlinux/platform_data/x86/pmc_atom.hlinux/pm_domain.hlinux/pm_runtime.hlinux/pwm.hlinux/pxa2xx_ssp.hlinux/suspend.hlinux/delay.h../internal.hasm/cpu_device_id.hasm/intel-family.hasm/iosf_mbi.h
Detected Declarations
struct lpss_private_datastruct lpss_device_descstruct lpss_private_datastruct lpss_device_linksstruct hid_uidfunction lpss_uart_setupfunction lpss_deassert_resetfunction byt_pwm_setupfunction byt_i2c_setupfunction bsw_pwm_setupfunction lpt_register_clock_devicefunction register_device_clockfunction acpi_lpss_is_supplierfunction acpi_lpss_is_consumerfunction match_hid_uidfunction acpi_lpss_link_consumerfunction acpi_lpss_link_supplierfunction acpi_lpss_create_device_linksfunction acpi_lpss_create_devicefunction __lpss_reg_readfunction __lpss_reg_writefunction lpss_reg_readfunction lpss_ltr_showfunction lpss_ltr_mode_showfunction acpi_lpss_set_ltrfunction acpi_lpss_save_ctxfunction acpi_lpss_restore_ctxfunction acpi_lpss_d3_to_d0_delayfunction acpi_lpss_activatefunction acpi_lpss_dismissfunction lpss_iosf_enter_d3_statefunction lpss_iosf_exit_d3_statefunction acpi_lpss_suspendfunction acpi_lpss_resumefunction acpi_lpss_do_suspend_latefunction acpi_lpss_suspend_latefunction acpi_lpss_suspend_noirqfunction acpi_lpss_do_resume_earlyfunction acpi_lpss_resume_earlyfunction acpi_lpss_resume_noirqfunction acpi_lpss_do_restore_earlyfunction acpi_lpss_restore_earlyfunction acpi_lpss_restore_noirqfunction acpi_lpss_do_poweroff_latefunction acpi_lpss_poweroff_latefunction acpi_lpss_poweroff_noirqfunction acpi_lpss_runtime_suspendfunction acpi_lpss_runtime_resume
Annotated Snippet
struct lpss_device_desc {
unsigned int flags;
const char *clk_con_id;
unsigned int prv_offset;
size_t prv_size_override;
const struct property_entry *properties;
void (*setup)(struct lpss_private_data *pdata);
bool resume_from_noirq;
};
static const struct lpss_device_desc lpss_dma_desc = {
.flags = LPSS_CLK,
};
struct lpss_private_data {
struct acpi_device *adev;
void __iomem *mmio_base;
resource_size_t mmio_size;
unsigned int fixed_clk_rate;
struct clk *clk;
const struct lpss_device_desc *dev_desc;
u32 prv_reg_ctx[LPSS_PRV_REG_COUNT];
};
/* Devices which need to be in D3 before lpss_iosf_enter_d3_state() proceeds */
static u32 pmc_atom_d3_mask = 0xfe000ffe;
/* LPSS run time quirks */
static unsigned int lpss_quirks;
/*
* LPSS_QUIRK_ALWAYS_POWER_ON: override power state for LPSS DMA device.
*
* The LPSS DMA controller has neither _PS0 nor _PS3 method. Moreover
* it can be powered off automatically whenever the last LPSS device goes down.
* In case of no power any access to the DMA controller will hang the system.
* The behaviour is reproduced on some HP laptops based on Intel BayTrail as
* well as on ASuS T100TA transformer.
*
* This quirk overrides power state of entire LPSS island to keep DMA powered
* on whenever we have at least one other device in use.
*/
#define LPSS_QUIRK_ALWAYS_POWER_ON BIT(0)
/* UART Component Parameter Register */
#define LPSS_UART_CPR 0xF4
#define LPSS_UART_CPR_AFCE BIT(4)
static void lpss_uart_setup(struct lpss_private_data *pdata)
{
unsigned int offset;
u32 val;
offset = pdata->dev_desc->prv_offset + LPSS_TX_INT;
val = readl(pdata->mmio_base + offset);
writel(val | LPSS_TX_INT_MASK, pdata->mmio_base + offset);
val = readl(pdata->mmio_base + LPSS_UART_CPR);
if (!(val & LPSS_UART_CPR_AFCE)) {
offset = pdata->dev_desc->prv_offset + LPSS_GENERAL;
val = readl(pdata->mmio_base + offset);
val |= LPSS_GENERAL_UART_RTS_OVRD;
writel(val, pdata->mmio_base + offset);
}
}
static void lpss_deassert_reset(struct lpss_private_data *pdata)
{
unsigned int offset;
u32 val;
offset = pdata->dev_desc->prv_offset + LPSS_RESETS;
val = readl(pdata->mmio_base + offset);
val |= LPSS_RESETS_RESET_APB | LPSS_RESETS_RESET_FUNC;
writel(val, pdata->mmio_base + offset);
}
/*
* BYT PWM used for backlight control by the i915 driver on systems without
* the Crystal Cove PMIC.
*/
static struct pwm_lookup byt_pwm_lookup[] = {
PWM_LOOKUP_WITH_MODULE("80860F09:00", 0, "0000:00:02.0",
"pwm_soc_backlight", 0, PWM_POLARITY_NORMAL,
"pwm-lpss-platform"),
};
static void byt_pwm_setup(struct lpss_private_data *pdata)
{
/* Only call pwm_add_table for the first PWM controller */
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/clkdev.h`, `linux/clk-provider.h`, `linux/dmi.h`, `linux/err.h`, `linux/io.h`, `linux/mutex.h`, `linux/pci.h`.
- Detected declarations: `struct lpss_private_data`, `struct lpss_device_desc`, `struct lpss_private_data`, `struct lpss_device_links`, `struct hid_uid`, `function lpss_uart_setup`, `function lpss_deassert_reset`, `function byt_pwm_setup`, `function byt_i2c_setup`, `function bsw_pwm_setup`.
- Atlas domain: Driver Families / drivers/acpi.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.