Skip to content

PlatformDevice

Defined in: src/drivers/base/platform.ts:13

attrs: Record<string, DeviceAttribute> = {}

Defined in: src/device.ts:151

CPU.attrs


optional bus?: BusType<Device<unknown>, DeviceDriver<Device<unknown>>>

Defined in: src/device.ts:128

Device.bus


optional class?: Class

Defined in: src/device.ts:131

Device.class


optional dev_t?: DevT

Defined in: src/device.ts:134

The device number. Devices with one get a dev attribute and a link in /sys/dev.

Device.dev_t


driver: PlatformDriver

Defined in: src/drivers/base/platform.ts:14

Device.driver


optional driver_data?: unknown

Defined in: src/device.ts:140

Whatever the bound driver wants to keep with the device, i.e. dev->driver_data

Device.driver_data


optional driver_override?: string

Defined in: src/drivers/base/platform.ts:26

Internal

Driver name to force a match.


id: number

Defined in: src/drivers/base/platform.ts:18

Device.id


id_entry: PlatformDeviceId

Defined in: src/drivers/base/platform.ts:21


idAuto: boolean

Defined in: src/drivers/base/platform.ts:19


optional kobj_parent?: KObject

Defined in: src/device.ts:146

Forces where the device goes in sysfs, like setting dev->kobj.parent before register. This is how a bus’ root device ends up somewhere like /sys/devices/system.

Device.kobj_parent


optional kobject?: DeviceKObject

Defined in: src/device.ts:149

/sys/devices/.../<name>. Only set while the device is registered.

CPU.kobject


readonly name: string

Defined in: src/drivers/base/platform.ts:17

Device.name


optional of_node?: object & object

Defined in: src/device.ts:137

The device tree node this device was created from, i.e. dev->of_node

optional id?: string

What the device is called under /sys/devices/platform. One is made up when there isn’t one.

kind: "xterm"

optional options?: AttachXTermOptions

terminal: XTermLike

Device.of_node


parent: PlatformDevice | null

Defined in: src/drivers/base/platform.ts:15

Device.parent


power: Partial<DevicePowerInfo> = {}

Defined in: src/device.ts:153

CPU.power


optional removable?: "unknown" | "removable" | "fixed"

Defined in: src/device.ts:155

CPU.removable


resources: Resource[]

Defined in: src/drivers/base/platform.ts:20


optional type?: DeviceType

Defined in: src/device.ts:130

Device.type

get path(): string | undefined

Defined in: src/device.ts:171

The device’s path relative to the root of sysfs, if it is registered

string | undefined

Device.path


get registered(): boolean

Defined in: src/device.ts:166

Whether the device is currently in sysfs

boolean

Device.registered

attach(): boolean

Defined in: src/device.ts:212

Look for a driver on the device’s bus that can handle it.

boolean

whether the device ended up bound

Device.attach


bind_driver(drv): void

Defined in: src/device.ts:255

Bind a device to a driver without probing it.

DeviceDriver

void

EBUSY if the device is already bound

Device.bind_driver


dev_node(): object

Defined in: src/device.ts:356

Internal

Work out the name and mode a device’s node under /dev should have.

object

a mode of 0 when nothing set one

mode: number

name: string

Device.dev_node


protected link_driver(): void

Defined in: src/device.ts:197

Link the device up with the driver it just bound to.

void

Device.link_driver


register(): void

Defined in: src/device.ts:284

Add a device to sysfs, link it up with its bus and class, then try to find it a driver.

void

EEXIST if the device is already registered, or something else has its name

Device.register


release_driver(): void

Defined in: src/device.ts:265

Unbind a device from its driver. Does nothing if it isn’t bound.

void

Device.release_driver


protected sysfs_parent(): KObject

Defined in: src/device.ts:178

Work out where a device goes in sysfs.

KObject

Device.sysfs_parent


try_bind(drv): boolean

Defined in: src/device.ts:234

Offer the device to a driver, binding the two if the driver’s probe accepts it. A driver without a probe takes every device the bus matched for it.

DeviceDriver

boolean

whether the device was bound

Device.try_bind


unregister(): void

Defined in: src/device.ts:327

Remove a device from sysfs, unbinding it from its driver first. Does nothing if the device isn’t registered.

void

Device.unregister