€•™‹Œsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ4/translations/zh_CN/driver-api/driver-model/platform”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ4/translations/zh_TW/driver-api/driver-model/platform”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ4/translations/it_IT/driver-api/driver-model/platform”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ4/translations/ja_JP/driver-api/driver-model/platform”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ4/translations/ko_KR/driver-api/driver-model/platform”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒPortuguese (Brazilian)”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ4/translations/pt_BR/driver-api/driver-model/platform”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ4/translations/sp_SP/driver-api/driver-model/platform”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒPlatform Devices and Drivers”h]”hŒPlatform Devices and Drivers”…””}”(hh¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhh·h²hh³ŒN/var/lib/git/docbuild/linux/Documentation/driver-api/driver-model/platform.rst”h´KubhŒ paragraph”“”)”}”(hXvSee for the driver model interface to the platform bus: platform_device, and platform_driver. This pseudo-bus is used to connect devices on buses with minimal infrastructure, like those used to integrate peripherals on many system-on-chip processors, or some "legacy" PC interconnects; as opposed to large formally specified ones like PCI or USB.”h]”hXzSee for the driver model interface to the platform bus: platform_device, and platform_driver. This pseudo-bus is used to connect devices on buses with minimal infrastructure, like those used to integrate peripherals on many system-on-chip processors, or some “legacy†PC interconnects; as opposed to large formally specified ones like PCI or USB.”…””}”(hhÍh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh·h²hubh¶)”}”(hhh]”(h»)”}”(hŒPlatform devices”h]”hŒPlatform devices”…””}”(hhÞh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhhÛh²hh³hÊh´KubhÌ)”}”(hX¼Platform devices are devices that typically appear as autonomous entities in the system. This includes legacy port-based devices and host bridges to peripheral buses, and most controllers integrated into system-on-chip platforms. What they usually have in common is direct addressing from a CPU bus. Rarely, a platform_device will be connected through a segment of some other kind of bus; but its registers will still be directly addressable.”h]”hX¼Platform devices are devices that typically appear as autonomous entities in the system. This includes legacy port-based devices and host bridges to peripheral buses, and most controllers integrated into system-on-chip platforms. What they usually have in common is direct addressing from a CPU bus. Rarely, a platform_device will be connected through a segment of some other kind of bus; but its registers will still be directly addressable.”…””}”(hhìh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KhhÛh²hubhÌ)”}”(hŒoPlatform devices are given a name, used in driver binding, and a list of resources such as addresses and IRQs::”h]”hŒnPlatform devices are given a name, used in driver binding, and a list of resources such as addresses and IRQs:”…””}”(hhúh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KhhÛh²hubhŒ literal_block”“”)”}”(hŒ³struct platform_device { const char *name; u32 id; struct device dev; u32 num_resources; struct resource *resource; };”h]”hŒ³struct platform_device { const char *name; u32 id; struct device dev; u32 num_resources; struct resource *resource; };”…””}”hj sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1jh³hÊh´KhhÛh²hubeh}”(h]”Œplatform-devices”ah ]”h"]”Œplatform devices”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kubh¶)”}”(hhh]”(h»)”}”(hŒPlatform drivers”h]”hŒPlatform drivers”…””}”(hj%h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj"h²hh³hÊh´K$ubhÌ)”}”(hXPlatform drivers follow the standard driver model convention, where discovery/enumeration is handled outside the drivers, and drivers provide probe() and remove() methods. They support power management and shutdown notifications using the standard conventions::”h]”hXPlatform drivers follow the standard driver model convention, where discovery/enumeration is handled outside the drivers, and drivers provide probe() and remove() methods. They support power management and shutdown notifications using the standard conventions:”…””}”(hj3h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K%hj"h²hubj )”}”(hX´struct platform_driver { int (*probe)(struct platform_device *); void (*remove)(struct platform_device *); void (*shutdown)(struct platform_device *); int (*suspend)(struct platform_device *, pm_message_t state); int (*resume)(struct platform_device *); struct device_driver driver; const struct platform_device_id *id_table; bool prevent_deferred_probe; bool driver_managed_dma; };”h]”hX´struct platform_driver { int (*probe)(struct platform_device *); void (*remove)(struct platform_device *); void (*shutdown)(struct platform_device *); int (*suspend)(struct platform_device *, pm_message_t state); int (*resume)(struct platform_device *); struct device_driver driver; const struct platform_device_id *id_table; bool prevent_deferred_probe; bool driver_managed_dma; };”…””}”hjAsbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´K*hj"h²hubhÌ)”}”(hŒÞNote that probe() should in general verify that the specified device hardware actually exists; sometimes platform setup code can't be sure. The probing can use device resources, including clocks, and device platform_data.”h]”hŒàNote that probe() should in general verify that the specified device hardware actually exists; sometimes platform setup code can’t be sure. The probing can use device resources, including clocks, and device platform_data.”…””}”(hjOh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K6hj"h²hubhÌ)”}”(hŒ5Platform drivers register themselves the normal way::”h]”hŒ4Platform drivers register themselves the normal way:”…””}”(hj]h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K:hj"h²hubj )”}”(hŒ:int platform_driver_register(struct platform_driver *drv);”h]”hŒ:int platform_driver_register(struct platform_driver *drv);”…””}”hjksbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´Khj"h²hubj )”}”(hŒpint platform_driver_probe(struct platform_driver *drv, int (*probe)(struct platform_device *))”h]”hŒpint platform_driver_probe(struct platform_driver *drv, int (*probe)(struct platform_device *))”…””}”hj‡sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´KBhj"h²hubhÌ)”}”(hŒKernel modules can be composed of several platform drivers. The platform core provides helpers to register and unregister an array of drivers::”h]”hŒŽKernel modules can be composed of several platform drivers. The platform core provides helpers to register and unregister an array of drivers:”…””}”(hj•h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KEhj"h²hubj )”}”(hXint __platform_register_drivers(struct platform_driver * const *drivers, unsigned int count, struct module *owner); void platform_unregister_drivers(struct platform_driver * const *drivers, unsigned int count);”h]”hXint __platform_register_drivers(struct platform_driver * const *drivers, unsigned int count, struct module *owner); void platform_unregister_drivers(struct platform_driver * const *drivers, unsigned int count);”…””}”hj£sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´KHhj"h²hubhÌ)”}”(hŒËIf one of the drivers fails to register, all drivers registered up to that point will be unregistered in reverse order. Note that there is a convenience macro that passes THIS_MODULE as owner parameter::”h]”hŒÊIf one of the drivers fails to register, all drivers registered up to that point will be unregistered in reverse order. Note that there is a convenience macro that passes THIS_MODULE as owner parameter:”…””}”(hj±h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KMhj"h²hubj )”}”(hŒ1#define platform_register_drivers(drivers, count)”h]”hŒ1#define platform_register_drivers(drivers, count)”…””}”hj¿sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´KQhj"h²hubeh}”(h]”Œplatform-drivers”ah ]”h"]”Œplatform drivers”ah$]”h&]”uh1hµhh·h²hh³hÊh´K$ubh¶)”}”(hhh]”(h»)”}”(hŒDevice Enumeration”h]”hŒDevice Enumeration”…””}”(hjØh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjÕh²hh³hÊh´KUubhÌ)”}”(hŒcAs a rule, platform specific (and often board-specific) setup code will register platform devices::”h]”hŒbAs a rule, platform specific (and often board-specific) setup code will register platform devices:”…””}”(hjæh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KVhjÕh²hubj )”}”(hŒ€int platform_device_register(struct platform_device *pdev); int platform_add_devices(struct platform_device **pdevs, int ndev);”h]”hŒ€int platform_device_register(struct platform_device *pdev); int platform_add_devices(struct platform_device **pdevs, int ndev);”…””}”hjôsbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´KYhjÕh²hubhÌ)”}”(hXdThe general rule is to register only those devices that actually exist, but in some cases extra devices might be registered. For example, a kernel might be configured to work with an external network adapter that might not be populated on all boards, or likewise to work with an integrated controller that some boards might not hook up to any peripherals.”h]”hXdThe general rule is to register only those devices that actually exist, but in some cases extra devices might be registered. For example, a kernel might be configured to work with an external network adapter that might not be populated on all boards, or likewise to work with an integrated controller that some boards might not hook up to any peripherals.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K]hjÕh²hubhÌ)”}”(hXQIn some cases, boot firmware will export tables describing the devices that are populated on a given board. Without such tables, often the only way for system setup code to set up the correct devices is to build a kernel for a specific target board. Such board-specific kernels are common with embedded and custom systems development.”h]”hXQIn some cases, boot firmware will export tables describing the devices that are populated on a given board. Without such tables, often the only way for system setup code to set up the correct devices is to build a kernel for a specific target board. Such board-specific kernels are common with embedded and custom systems development.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KchjÕh²hubhÌ)”}”(hXIn many cases, the memory and IRQ resources associated with the platform device are not enough to let the device's driver work. Board setup code will often provide additional information using the device's platform_data field to hold additional information.”h]”hXIn many cases, the memory and IRQ resources associated with the platform device are not enough to let the device’s driver work. Board setup code will often provide additional information using the device’s platform_data field to hold additional information.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KihjÕh²hubhÌ)”}”(hXEmbedded systems frequently need one or more clocks for platform devices, which are normally kept off until they're actively needed (to save power). System setup also associates those clocks with the device, so that calls to clk_get(&pdev->dev, clock_name) return them as needed.”h]”hXEmbedded systems frequently need one or more clocks for platform devices, which are normally kept off until they’re actively needed (to save power). System setup also associates those clocks with the device, so that calls to clk_get(&pdev->dev, clock_name) return them as needed.”…””}”(hj,h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KnhjÕh²hubeh}”(h]”Œdevice-enumeration”ah ]”h"]”Œdevice enumeration”ah$]”h&]”uh1hµhh·h²hh³hÊh´KUubh¶)”}”(hhh]”(h»)”}”(hŒLegacy Drivers: Device Probing”h]”hŒLegacy Drivers: Device Probing”…””}”(hjEh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjBh²hh³hÊh´KuubhÌ)”}”(hXXSome drivers are not fully converted to the driver model, because they take on a non-driver role: the driver registers its platform device, rather than leaving that for system infrastructure. Such drivers can't be hotplugged or coldplugged, since those mechanisms require device creation to be in a different system component than the driver.”h]”hXZSome drivers are not fully converted to the driver model, because they take on a non-driver role: the driver registers its platform device, rather than leaving that for system infrastructure. Such drivers can’t be hotplugged or coldplugged, since those mechanisms require device creation to be in a different system component than the driver.”…””}”(hjSh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KvhjBh²hubhÌ)”}”(hXThe only "good" reason for this is to handle older system designs which, like original IBM PCs, rely on error-prone "probe-the-hardware" models for hardware configuration. Newer systems have largely abandoned that model, in favor of bus-level support for dynamic configuration (PCI, USB), or device tables provided by the boot firmware (e.g. PNPACPI on x86). There are too many conflicting options about what might be where, and even educated guesses by an operating system will be wrong often enough to make trouble.”h]”hXThe only “good†reason for this is to handle older system designs which, like original IBM PCs, rely on error-prone “probe-the-hardware†models for hardware configuration. Newer systems have largely abandoned that model, in favor of bus-level support for dynamic configuration (PCI, USB), or device tables provided by the boot firmware (e.g. PNPACPI on x86). There are too many conflicting options about what might be where, and even educated guesses by an operating system will be wrong often enough to make trouble.”…””}”(hjah²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K|hjBh²hubhÌ)”}”(hXRThis style of driver is discouraged. If you're updating such a driver, please try to move the device enumeration to a more appropriate location, outside the driver. This will usually be cleanup, since such drivers tend to already have "normal" modes, such as ones using device nodes that were created by PNP or by platform device setup.”h]”hXXThis style of driver is discouraged. If you’re updating such a driver, please try to move the device enumeration to a more appropriate location, outside the driver. This will usually be cleanup, since such drivers tend to already have “normal†modes, such as ones using device nodes that were created by PNP or by platform device setup.”…””}”(hjoh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K„hjBh²hubhÌ)”}”(hŒˆNone the less, there are some APIs to support such legacy drivers. Avoid using these calls except with such hotplug-deficient drivers::”h]”hŒ‡None the less, there are some APIs to support such legacy drivers. Avoid using these calls except with such hotplug-deficient drivers:”…””}”(hj}h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KŠhjBh²hubj )”}”(hŒYstruct platform_device *platform_device_alloc( const char *name, int id);”h]”hŒYstruct platform_device *platform_device_alloc( const char *name, int id);”…””}”hj‹sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´KhjBh²hubhÌ)”}”(hŒ²You can use platform_device_alloc() to dynamically allocate a device, which you will then initialize with resources and platform_device_register(). A better solution is usually::”h]”hŒ±You can use platform_device_alloc() to dynamically allocate a device, which you will then initialize with resources and platform_device_register(). A better solution is usually:”…””}”(hj™h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KhjBh²hubj )”}”(hŒœstruct platform_device *platform_device_register_simple( const char *name, int id, struct resource *res, unsigned int nres);”h]”hŒœstruct platform_device *platform_device_register_simple( const char *name, int id, struct resource *res, unsigned int nres);”…””}”hj§sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1jh³hÊh´K”hjBh²hubhÌ)”}”(hŒcYou can use platform_device_register_simple() as a one-step call to allocate and register a device.”h]”hŒcYou can use platform_device_register_simple() as a one-step call to allocate and register a device.”…””}”(hjµh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K˜hjBh²hubeh}”(h]”Œlegacy-drivers-device-probing”ah ]”h"]”Œlegacy drivers: device probing”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kuubh¶)”}”(hhh]”(h»)”}”(hŒ Device Naming and Driver Binding”h]”hŒ Device Naming and Driver Binding”…””}”(hjÎh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjËh²hh³hÊh´KubhÌ)”}”(hŒeThe platform_device.dev.bus_id is the canonical name for the devices. It's built from two components:”h]”hŒgThe platform_device.dev.bus_id is the canonical name for the devices. It’s built from two components:”…””}”(hjÜh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KžhjËh²hubhŒ block_quote”“”)”}”(hŒ©* platform_device.name ... which is also used to for driver matching. * platform_device.id ... the device instance number, or else "-1" to indicate there's only one. ”h]”hŒ bullet_list”“”)”}”(hhh]”(hŒ list_item”“”)”}”(hŒDplatform_device.name ... which is also used to for driver matching. ”h]”hÌ)”}”(hŒCplatform_device.name ... which is also used to for driver matching.”h]”hŒCplatform_device.name ... which is also used to for driver matching.”…””}”(hjûh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¡hj÷ubah}”(h]”h ]”h"]”h$]”h&]”uh1jõhjòubjö)”}”(hŒ^platform_device.id ... the device instance number, or else "-1" to indicate there's only one. ”h]”hÌ)”}”(hŒ]platform_device.id ... the device instance number, or else "-1" to indicate there's only one.”h]”hŒcplatform_device.id ... the device instance number, or else “-1†to indicate there’s only one.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K£hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jõhjòubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ*”uh1jðh³hÊh´K¡hjìubah}”(h]”h ]”h"]”h$]”h&]”uh1jêh³hÊh´K¡hjËh²hubhÌ)”}”(hXThese are concatenated, so name/id "serial"/0 indicates bus_id "serial.0", and "serial/3" indicates bus_id "serial.3"; both would use the platform_driver named "serial". While "my_rtc"/-1 would be bus_id "my_rtc" (no instance id) and use the platform_driver called "my_rtc".”h]”hX3These are concatenated, so name/id “serialâ€/0 indicates bus_id “serial.0â€, and “serial/3†indicates bus_id “serial.3â€; both would use the platform_driver named “serialâ€. While “my_rtcâ€/-1 would be bus_id “my_rtc†(no instance id) and use the platform_driver called “my_rtcâ€.”…””}”(hj5h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¦hjËh²hubhÌ)”}”(hXDriver binding is performed automatically by the driver core, invoking driver probe() after finding a match between device and driver. If the probe() succeeds, the driver and device are bound as usual. There are three different ways to find such a match:”h]”hXDriver binding is performed automatically by the driver core, invoking driver probe() after finding a match between device and driver. If the probe() succeeds, the driver and device are bound as usual. There are three different ways to find such a match:”…””}”(hjCh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K«hjËh²hubjë)”}”(hXp- Whenever a device is registered, the drivers for that bus are checked for matches. Platform devices should be registered very early during system boot. - When a driver is registered using platform_driver_register(), all unbound devices on that bus are checked for matches. Drivers usually register later during booting, or by module loading. - Registering a driver using platform_driver_probe() works just like using platform_driver_register(), except that the driver won't be probed later if another device registers. (Which is OK, since this interface is only for use with non-hotpluggable devices.) ”h]”jñ)”}”(hhh]”(jö)”}”(hŒ™Whenever a device is registered, the drivers for that bus are checked for matches. Platform devices should be registered very early during system boot. ”h]”hÌ)”}”(hŒ˜Whenever a device is registered, the drivers for that bus are checked for matches. Platform devices should be registered very early during system boot.”h]”hŒ˜Whenever a device is registered, the drivers for that bus are checked for matches. Platform devices should be registered very early during system boot.”…””}”(hj\h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K°hjXubah}”(h]”h ]”h"]”h$]”h&]”uh1jõhjUubjö)”}”(hŒ½When a driver is registered using platform_driver_register(), all unbound devices on that bus are checked for matches. Drivers usually register later during booting, or by module loading. ”h]”hÌ)”}”(hŒ¼When a driver is registered using platform_driver_register(), all unbound devices on that bus are checked for matches. Drivers usually register later during booting, or by module loading.”h]”hŒ¼When a driver is registered using platform_driver_register(), all unbound devices on that bus are checked for matches. Drivers usually register later during booting, or by module loading.”…””}”(hjth²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K´hjpubah}”(h]”h ]”h"]”h$]”h&]”uh1jõhjUubjö)”}”(hXRegistering a driver using platform_driver_probe() works just like using platform_driver_register(), except that the driver won't be probed later if another device registers. (Which is OK, since this interface is only for use with non-hotpluggable devices.) ”h]”hÌ)”}”(hXRegistering a driver using platform_driver_probe() works just like using platform_driver_register(), except that the driver won't be probed later if another device registers. (Which is OK, since this interface is only for use with non-hotpluggable devices.)”h]”hXRegistering a driver using platform_driver_probe() works just like using platform_driver_register(), except that the driver won’t be probed later if another device registers. (Which is OK, since this interface is only for use with non-hotpluggable devices.)”…””}”(hjŒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¸hjˆubah}”(h]”h ]”h"]”h$]”h&]”uh1jõhjUubeh}”(h]”h ]”h"]”h$]”h&]”j-Œ-”uh1jðh³hÊh´K°hjQubah}”(h]”h ]”h"]”h$]”h&]”uh1jêh³hÊh´K°hjËh²hubeh}”(h]”Œ device-naming-and-driver-binding”ah ]”h"]”Œ device naming and driver binding”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kubh¶)”}”(hhh]”(h»)”}”(hŒ"Early Platform Devices and Drivers”h]”hŒ"Early Platform Devices and Drivers”…””}”(hj¸h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjµh²hh³hÊh´K¿ubhÌ)”}”(hŒÕThe early platform interfaces provide platform data to platform device drivers early on during the system boot. The code is built on top of the early_param() command line parsing and can be executed very early on.”h]”hŒÕThe early platform interfaces provide platform data to platform device drivers early on during the system boot. The code is built on top of the early_param() command line parsing and can be executed very early on.”…””}”(hjÆh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KÀhjµh²hubhÌ)”}”(hŒinstalling-early-platform-drivers-belonging-to-a-certain-class”ah ]”h"]”ŒA3. installing early platform drivers belonging to a certain class”ah$]”h&]”uh1hµhh·h²hh³hÊh´KÙubh¶)”}”(hhh]”(h»)”}”(hŒ%4. Early platform driver registration”h]”hŒ%4. Early platform driver registration”…””}”(hjbh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj_h²hh³hÊh´KâubhÌ)”}”(hŒÌCompiled-in platform drivers making use of early_platform_init() are automatically registered during step 2 or 3. The serial driver example should use early_platform_init("earlyprintk", &platform_driver).”h]”hŒÐCompiled-in platform drivers making use of early_platform_init() are automatically registered during step 2 or 3. The serial driver example should use early_platform_init(“earlyprintkâ€, &platform_driver).”…””}”(hjph²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kãhj_h²hubeh}”(h]”Œ"early-platform-driver-registration”ah ]”h"]”Œ%4. early platform driver registration”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kâubh¶)”}”(hhh]”(h»)”}”(hŒA5. Probing of early platform drivers belonging to a certain class”h]”hŒA5. Probing of early platform drivers belonging to a certain class”…””}”(hj‰h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj†h²hh³hÊh´KèubhÌ)”}”(hXGThe architecture code calls early_platform_driver_probe() to match registered early platform devices associated with a certain class with registered early platform drivers. Matched devices will get probed(). This step can be executed at any point during the early boot. As soon as possible may be good for the serial port case.”h]”hXGThe architecture code calls early_platform_driver_probe() to match registered early platform devices associated with a certain class with registered early platform drivers. Matched devices will get probed(). This step can be executed at any point during the early boot. As soon as possible may be good for the serial port case.”…””}”(hj—h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kéhj†h²hubeh}”(h]”Œ>probing-of-early-platform-drivers-belonging-to-a-certain-class”ah ]”h"]”ŒA5. probing of early platform drivers belonging to a certain class”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kèubh¶)”}”(hhh]”(h»)”}”(hŒ+6. Inside the early platform driver probe()”h]”hŒ+6. Inside the early platform driver probe()”…””}”(hj°h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj­h²hh³hÊh´KðubhÌ)”}”(hXhThe driver code needs to take special care during early boot, especially when it comes to memory allocation and interrupt registration. The code in the probe() function can use is_early_platform_device() to check if it is called at early platform device or at the regular platform device time. The early serial driver performs register_console() at this point.”h]”hXhThe driver code needs to take special care during early boot, especially when it comes to memory allocation and interrupt registration. The code in the probe() function can use is_early_platform_device() to check if it is called at early platform device or at the regular platform device time. The early serial driver performs register_console() at this point.”…””}”(hj¾h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kñhj­h²hubhÌ)”}”(hŒ7For further information, see .”h]”hŒ7For further information, see .”…””}”(hjÌh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K÷hj­h²hubeh}”(h]”Œ&inside-the-early-platform-driver-probe”ah ]”h"]”Œ+6. inside the early platform driver probe()”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kðubeh}”(h]”Œplatform-devices-and-drivers”ah ]”h"]”Œplatform devices and drivers”ah$]”h&]”uh1hµhhh²hh³hÊh´Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÊuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(hºNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”j Œerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÊŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(jçjäjjjÒjÏj?j<jÈjÅj²j¯jçjäjj j5j2j\jYjƒj€jªj§jßjÜuŒ nametypes”}”(jç‰j‰jÒ‰j?‰jȉj²‰jç‰j‰j5‰j\‰jƒ‰jª‰j߉uh}”(jäh·jhÛjÏj"j<jÕjÅjBj¯jËjäjµj jêj2jjYj8j€j_j§j†jÜj­uŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.