Skip to content

PlatformDriver

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

new PlatformDriver(init): PlatformDriver

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

PlatformDriverInit

PlatformDriver

DeviceDriver.constructor

readonly attrs: Record<string, DriverAttribute>

Defined in: src/drivers/base/driver.ts:64

DeviceDriver.attrs


readonly bus: BusType

Defined in: src/drivers/base/driver.ts:45

DeviceDriver.bus


readonly dev_attrs: Record<string, DeviceAttribute>

Defined in: src/drivers/base/driver.ts:65

DeviceDriver.dev_attrs


optional disableSysfsBind?: boolean

Defined in: src/drivers/base/driver.ts:59

Don’t add the bind and unbind attributes

DeviceDriver.disableSysfsBind


optional driver_managed_dma?: boolean

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


optional id_table?: PlatformDeviceId[]

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


optional kobject?: KObject

Defined in: src/drivers/base/driver.ts:56

Internal

/sys/bus/<bus>/drivers/<name>, set by register.

DeviceDriver.kobject


readonly optional mod_name?: string

Defined in: src/drivers/base/driver.ts:50

Used for built-in modules

DeviceDriver.mod_name


readonly name: string

Defined in: src/drivers/base/driver.ts:44

DeviceDriver.name


readonly optional of_match_table?: readonly "xterm"[]

Defined in: src/drivers/base/driver.ts:62

The device tree node kinds this driver handles, i.e. driver->of_match_table

DeviceDriver.of_match_table


optional owner?: Module

Defined in: src/drivers/base/driver.ts:48

The module this driver is part of. Built-in drivers don’t have one.

DeviceDriver.owner


optional prevent_deferred_probe?: boolean

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

get protected link_name(): string

Defined in: src/drivers/base/driver.ts:104

The name this driver is linked as in /sys/module/<module>/drivers.

string

DeviceDriver.link_name


get protected module(): Module | null

Defined in: src/drivers/base/driver.ts:111

The module this driver belongs to, which is either the one it was registered with or the built-in one named by mod_name.

Module | null

DeviceDriver.module

attach(): void

Defined in: src/drivers/base/driver.ts:167

Offer every unbound device on the bus to this driver.

void

DeviceDriver.attach


bind(name): void

Defined in: src/drivers/base/driver.ts:179

Bind the device named name to this driver. Backs the bind attribute.

string

void

ENODEV if there is no such device on the bus, or the bus doesn’t match it

EBUSY if the device already has a driver

DeviceDriver.bind


matches(device): boolean

Defined in: src/drivers/base/driver.ts:96

Whether this driver can handle device, according to the bus they share. A bus without a match accepts every device on it, like Linux.

Device

boolean

DeviceDriver.matches


optional probe(device): boolean

Defined in: src/drivers/base/driver.ts:82

PlatformDevice

boolean

DeviceDriver.probe


register(): void

Defined in: src/drivers/base/driver.ts:120

Add the driver to its bus, creating /sys/bus/<bus>/drivers/<name>, then offer it every unbound device on the bus.

void

EEXIST if the driver is already registered, or the bus already has one by that name

DeviceDriver.register


optional remove(device): void

Defined in: src/drivers/base/driver.ts:84

PlatformDevice

void

DeviceDriver.remove


optional resume(device): void

Defined in: src/drivers/base/driver.ts:88

PlatformDevice

void

DeviceDriver.resume


optional shutdown(device): void

Defined in: src/drivers/base/driver.ts:85

PlatformDevice

void

DeviceDriver.shutdown


optional suspend(device): void

Defined in: src/drivers/base/driver.ts:87

PlatformDevice

void

DeviceDriver.suspend


unbind(name): void

Defined in: src/drivers/base/driver.ts:191

Unbind the device named name from this driver. Backs the unbind attribute.

string

void

ENODEV if there is no such device on the bus, or it isn’t bound to this driver

DeviceDriver.unbind


unregister(): void

Defined in: src/drivers/base/driver.ts:147

Undo register, unbinding every device the driver is bound to

void

DeviceDriver.unregister