PlatformDevice
Defined in: src/drivers/base/platform.ts:13
Extends
Section titled “Extends”Properties
Section titled “Properties”attrs:
Record<string,DeviceAttribute> ={}
Defined in: src/device.ts:151
Inherited from
Section titled “Inherited from”
optionalbus?:BusType<Device<unknown>,DeviceDriver<Device<unknown>>>
Defined in: src/device.ts:128
Inherited from
Section titled “Inherited from”class?
Section titled “class?”
optionalclass?:Class
Defined in: src/device.ts:131
Inherited from
Section titled “Inherited from”dev_t?
Section titled “dev_t?”
optionaldev_t?:DevT
Defined in: src/device.ts:134
The device number. Devices with one get a dev attribute and a link in /sys/dev.
Inherited from
Section titled “Inherited from”driver
Section titled “driver”driver:
PlatformDriver
Defined in: src/drivers/base/platform.ts:14
Overrides
Section titled “Overrides”driver_data?
Section titled “driver_data?”
optionaldriver_data?:unknown
Defined in: src/device.ts:140
Whatever the bound driver wants to keep with the device, i.e. dev->driver_data
Inherited from
Section titled “Inherited from”driver_override?
Section titled “driver_override?”
optionaldriver_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
Overrides
Section titled “Overrides”id_entry
Section titled “id_entry”id_entry:
PlatformDeviceId
Defined in: src/drivers/base/platform.ts:21
idAuto
Section titled “idAuto”idAuto:
boolean
Defined in: src/drivers/base/platform.ts:19
kobj_parent?
Section titled “kobj_parent?”
optionalkobj_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.
Inherited from
Section titled “Inherited from”kobject?
Section titled “kobject?”
optionalkobject?:DeviceKObject
Defined in: src/device.ts:149
/sys/devices/.../<name>. Only set while the device is registered.
Inherited from
Section titled “Inherited from”
readonlyname:string
Defined in: src/drivers/base/platform.ts:17
Overrides
Section titled “Overrides”of_node?
Section titled “of_node?”
optionalof_node?:object&object
Defined in: src/device.ts:137
The device tree node this device was created from, i.e. dev->of_node
Type Declaration
Section titled “Type Declaration”
optionalid?:string
What the device is called under /sys/devices/platform. One is made up when there isn’t one.
kind:
"xterm"
Type Declaration
Section titled “Type Declaration”options?
Section titled “options?”
optionaloptions?:AttachXTermOptions
terminal
Section titled “terminal”terminal:
XTermLike
Inherited from
Section titled “Inherited from”parent
Section titled “parent”parent:
PlatformDevice|null
Defined in: src/drivers/base/platform.ts:15
Overrides
Section titled “Overrides”power:
Partial<DevicePowerInfo> ={}
Defined in: src/device.ts:153
Inherited from
Section titled “Inherited from”removable?
Section titled “removable?”
optionalremovable?:"unknown"|"removable"|"fixed"
Defined in: src/device.ts:155
Inherited from
Section titled “Inherited from”resources
Section titled “resources”resources:
Resource[]
Defined in: src/drivers/base/platform.ts:20
optionaltype?:DeviceType
Defined in: src/device.ts:130
Inherited from
Section titled “Inherited from”Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get path():
string|undefined
Defined in: src/device.ts:171
The device’s path relative to the root of sysfs, if it is registered
Returns
Section titled “Returns”string | undefined
Inherited from
Section titled “Inherited from”registered
Section titled “registered”Get Signature
Section titled “Get Signature”get registered():
boolean
Defined in: src/device.ts:166
Whether the device is currently in sysfs
Returns
Section titled “Returns”boolean
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”attach()
Section titled “attach()”attach():
boolean
Defined in: src/device.ts:212
Look for a driver on the device’s bus that can handle it.
Returns
Section titled “Returns”boolean
whether the device ended up bound
Inherited from
Section titled “Inherited from”bind_driver()
Section titled “bind_driver()”bind_driver(
drv):void
Defined in: src/device.ts:255
Bind a device to a driver without probing it.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
Throws
Section titled “Throws”EBUSY if the device is already bound
Inherited from
Section titled “Inherited from”dev_node()
Section titled “dev_node()”dev_node():
object
Defined in: src/device.ts:356
Internal
Work out the name and mode a device’s node under /dev should have.
Returns
Section titled “Returns”object
a mode of 0 when nothing set one
mode:
number
name:
string
Inherited from
Section titled “Inherited from”link_driver()
Section titled “link_driver()”
protectedlink_driver():void
Defined in: src/device.ts:197
Link the device up with the driver it just bound to.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”register()
Section titled “register()”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.
Returns
Section titled “Returns”void
Throws
Section titled “Throws”EEXIST if the device is already registered, or something else has its name
Inherited from
Section titled “Inherited from”release_driver()
Section titled “release_driver()”release_driver():
void
Defined in: src/device.ts:265
Unbind a device from its driver. Does nothing if it isn’t bound.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”sysfs_parent()
Section titled “sysfs_parent()”
protectedsysfs_parent():KObject
Defined in: src/device.ts:178
Work out where a device goes in sysfs.
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”try_bind()
Section titled “try_bind()”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.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”boolean
whether the device was bound
Inherited from
Section titled “Inherited from”unregister()
Section titled “unregister()”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.
Returns
Section titled “Returns”void