arch/arm/mach-omap1/board-sx1.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-omap1/board-sx1.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-omap1/board-sx1.c- Extension
.c- Size
- 9081 bytes
- Lines
- 372
- Domain
- Architecture Layer
- Bucket
- arch/arm
- Inferred role
- Architecture Layer: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/gpio/machine.hlinux/gpio/consumer.hlinux/kernel.hlinux/init.hlinux/input.hlinux/platform_device.hlinux/notifier.hlinux/mtd/mtd.hlinux/mtd/partitions.hlinux/mtd/physmap.hlinux/types.hlinux/i2c.hlinux/errno.hlinux/export.hlinux/omapfb.hlinux/platform_data/keypad-omap.hlinux/omap-dma.htc.hasm/mach-types.hasm/mach/arch.hasm/mach/map.hflash.hmux.hboard-sx1.hhardware.husb.hcommon.h
Detected Declarations
function sx1_i2c_write_bytefunction sx1_i2c_read_bytefunction sx1_setkeylightfunction sx1_getkeylightfunction sx1_setbacklightfunction sx1_getbacklightfunction sx1_setmmipowerfunction sx1_setusbpowerfunction omap_sx1_initexport sx1_setkeylightexport sx1_getkeylightexport sx1_setbacklightexport sx1_getbacklightexport sx1_setmmipowerexport sx1_setusbpower
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* linux/arch/arm/mach-omap1/board-sx1.c
*
* Modified from board-generic.c
*
* Support for the Siemens SX1 mobile phone.
*
* Original version : Vladimir Ananiev (Vovan888-at-gmail com)
*
* Maintainters : Vladimir Ananiev (aka Vovan888), Sergge
* oslik.ru
*/
#include <linux/gpio/machine.h>
#include <linux/gpio/consumer.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/input.h>
#include <linux/platform_device.h>
#include <linux/notifier.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/mtd/physmap.h>
#include <linux/types.h>
#include <linux/i2c.h>
#include <linux/errno.h>
#include <linux/export.h>
#include <linux/omapfb.h>
#include <linux/platform_data/keypad-omap.h>
#include <linux/omap-dma.h>
#include "tc.h"
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include "flash.h"
#include "mux.h"
#include "board-sx1.h"
#include "hardware.h"
#include "usb.h"
#include "common.h"
/* Write to I2C device */
int sx1_i2c_write_byte(u8 devaddr, u8 regoffset, u8 value)
{
struct i2c_adapter *adap;
int err;
struct i2c_msg msg[1];
unsigned char data[2];
adap = i2c_get_adapter(0);
if (!adap)
return -ENODEV;
msg->addr = devaddr; /* I2C address of chip */
msg->flags = 0;
msg->len = 2;
msg->buf = data;
data[0] = regoffset; /* register num */
data[1] = value; /* register data */
err = i2c_transfer(adap, msg, 1);
i2c_put_adapter(adap);
if (err >= 0)
return 0;
return err;
}
/* Read from I2C device */
int sx1_i2c_read_byte(u8 devaddr, u8 regoffset, u8 *value)
{
struct i2c_adapter *adap;
int err;
struct i2c_msg msg[1];
unsigned char data[2];
adap = i2c_get_adapter(0);
if (!adap)
return -ENODEV;
msg->addr = devaddr; /* I2C address of chip */
msg->flags = 0;
msg->len = 1;
msg->buf = data;
data[0] = regoffset; /* register num */
err = i2c_transfer(adap, msg, 1);
msg->addr = devaddr; /* I2C address */
msg->flags = I2C_M_RD;
msg->len = 1;
msg->buf = data;
Annotation
- Immediate include surface: `linux/gpio/machine.h`, `linux/gpio/consumer.h`, `linux/kernel.h`, `linux/init.h`, `linux/input.h`, `linux/platform_device.h`, `linux/notifier.h`, `linux/mtd/mtd.h`.
- Detected declarations: `function sx1_i2c_write_byte`, `function sx1_i2c_read_byte`, `function sx1_setkeylight`, `function sx1_getkeylight`, `function sx1_setbacklight`, `function sx1_getbacklight`, `function sx1_setmmipower`, `function sx1_setusbpower`, `function omap_sx1_init`, `export sx1_setkeylight`.
- Atlas domain: Architecture Layer / arch/arm.
- Implementation status: integration implementation candidate.
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.