€•…ŠŒ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Œ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”“”)”}”(hXwSee for the driver model interface to the platform bus: platform_device, and platform_driver. This pseudo-bus is used to connect devices on busses 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]”hX{See for the driver model interface to the platform bus: platform_device, and platform_driver. This pseudo-bus is used to connect devices on busses 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; };”…””}”hhösbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hôhŸ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”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjhž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:”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K%hjhžhubhõ)”}”(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; };”…””}”hj-sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1hôhŸh¶h K*hjhž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.”…””}”(hj;hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K6hjhžhubh¸)”}”(hŒ5Platform drivers register themselves the normal way::”h]”hŒ4Platform drivers register themselves the normal way:”…””}”(hjIhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K:hjhžhubhõ)”}”(hŒ:int platform_driver_register(struct platform_driver *drv);”h]”hŒ:int platform_driver_register(struct platform_driver *drv);”…””}”hjWsbah}”(h]”h ]”h"]”h$]”h&]”jjuh1hôhŸh¶h Khjhžhubhõ)”}”(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 *))”…””}”hjssbah}”(h]”h ]”h"]”h$]”h&]”jjuh1hôhŸh¶h KBhjhž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:”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KEhjhžhubhõ)”}”(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);”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”jjuh1hôhŸh¶h KHhjhž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:”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KMhjhžhubhõ)”}”(hŒ1#define platform_register_drivers(drivers, count)”h]”hŒ1#define platform_register_drivers(drivers, count)”…””}”hj«sbah}”(h]”h ]”h"]”h$]”h&]”jjuh1hôhŸh¶h KQhjhž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žhubhõ)”}”(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&]”jjuh1hôhŸ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.”…””}”(hjîhž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.”…””}”(hjühž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.”…””}”(hj hž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.”…””}”(hjhž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”…””}”(hj1hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hj.hž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.”…””}”(hj?hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Kvhj.hž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.”…””}”(hjMhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K|hj.hž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.”…””}”(hj[hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K„hj.hž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:”…””}”(hjihžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KŠhj.hžhubhõ)”}”(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);”…””}”hjwsbah}”(h]”h ]”h"]”h$]”h&]”jjuh1hôhŸh¶h Khj.hž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 Khj.hžhubhõ)”}”(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&]”jjuh1hôhŸh¶h K”hj.hž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˜hj.hž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.”…””}”(hjÿhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K£hjûubah}”(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â€.”…””}”(hj!hž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:”…””}”(hj/hž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.”…””}”(hjHhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K°hjDubah}”(h]”h ]”h"]”h$]”h&]”uh1jáhjAubjâ)”}”(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.”…””}”(hj`hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K´hj\ubah}”(h]”h ]”h"]”h$]”h&]”uh1jáhjAubjâ)”}”(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.)”…””}”(hjxhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K¸hjtubah}”(h]”h ]”h"]”h$]”h&]”uh1jáhjAubeh}”(h]”h ]”h"]”h$]”h&]”jŒ-”uh1jÜhŸh¶h K°hj=ubah}”(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”…””}”(hjNhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjKhž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).”…””}”(hj\hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KãhjKhž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”…””}”(hjuhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjrhž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éhjrhž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Ðj jj¾j»j+j(j´j±jžj›jÓjÐjúj÷j!jjHjEjojlj–j“jËjÈuŒ nametypes”}”(jÓ‰j ‰j¾‰j+‰j´‰jž‰jÓ‰jú‰j!‰jH‰jo‰j–‰jˉuh}”(jÐh£jhÇj»jj(jÁj±j.j›j·jÐj¡j÷jÖjjýjEj$jljKj“jrjÈ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.