The MHI register base has several registers used for getting the MHI specific information such as version, family, major, and minor numbers from the device. This information can be used by the controller drivers for usecases such as applying quirks for a specific revision etc... While at it, let's also rearrange the local variables in mhi_register_controller().
Showing the changes to include/linux (1 of 3 files). Show all
Unified · Split
| @@ -310,6 +310,10 @@ struct mhi_controller_config { · 309 unmodified lines | |||
| 310 | * @sw_ev_rings: Number of software event rings | 310 | * @sw_ev_rings: Number of software event rings |
| 311 | * @nr_irqs_req: Number of IRQs required to operate (optional) | 311 | * @nr_irqs_req: Number of IRQs required to operate (optional) |
| 312 | * @nr_irqs: Number of IRQ allocated by bus master (required) | 312 | * @nr_irqs: Number of IRQ allocated by bus master (required) |
| 313 | * @family_number: MHI controller family number | ||
| 314 | * @device_number: MHI controller device number | ||
| 315 | * @major_version: MHI controller major revision number | ||
| 316 | * @minor_version: MHI controller minor revision number | ||
| 313 | * @mhi_event: MHI event ring configurations table | 317 | * @mhi_event: MHI event ring configurations table |
| 314 | * @mhi_cmd: MHI command ring configurations table | 318 | * @mhi_cmd: MHI command ring configurations table |
| 315 | * @mhi_ctxt: MHI device context, shared memory between host and device | 319 | * @mhi_ctxt: MHI device context, shared memory between host and device |
| @@ -348,6 +352,15 @@ struct mhi_controller_config { · 32 unmodified lines | |||
| 348 | * Fields marked as (required) need to be populated by the controller driver | 352 | * Fields marked as (required) need to be populated by the controller driver |
| 349 | * before calling mhi_register_controller(). For the fields marked as (optional) | 353 | * before calling mhi_register_controller(). For the fields marked as (optional) |
| 350 | * they can be populated depending on the usecase. | 354 | * they can be populated depending on the usecase. |
| 355 | * | ||
| 356 | * The following fields are present for the purpose of implementing any device | ||
| 357 | * specific quirks or customizations for specific MHI revisions used in device | ||
| 358 | * by the controller drivers. The MHI stack will just populate these fields | ||
| 359 | * during mhi_register_controller(): | ||
| 360 | * family_number | ||
| 361 | * device_number | ||
| 362 | * major_version | ||
| 363 | * minor_version | ||
| 351 | */ | 364 | */ |
| 352 | struct mhi_controller { | 365 | struct mhi_controller { |
| 353 | struct device *cntrl_dev; | 366 | struct device *cntrl_dev; |
| @@ -375,6 +388,10 @@ struct mhi_controller { · 21 unmodified lines | |||
| 375 | u32 sw_ev_rings; | 388 | u32 sw_ev_rings; |
| 376 | u32 nr_irqs_req; | 389 | u32 nr_irqs_req; |
| 377 | u32 nr_irqs; | 390 | u32 nr_irqs; |
| 391 | u32 family_number; | ||
| 392 | u32 device_number; | ||
| 393 | u32 major_version; | ||
| 394 | u32 minor_version; | ||
| 378 | 395 | ||
| 379 | struct mhi_event *mhi_event; | 396 | struct mhi_event *mhi_event; |
| 380 | struct mhi_cmd *mhi_cmd; | 397 | struct mhi_cmd *mhi_cmd; |