History

bus: mhi: core: Add support for reading MHI info from device

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().

Manivannan Sadhasivam committed 6 years ago

Commit 3316ab21 parent 10cea233 files · +44 −2Browse files

Showing the changes to include/linux (1 of 3 files). Show all

Unified · Split

include/linux/mhi.h+17−0
@@ -310,6 +310,10 @@ struct mhi_controller_config { · 309 unmodified lines
310 * @sw_ev_rings: Number of software event rings310 * @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 table317 * @mhi_event: MHI event ring configurations table
314 * @mhi_cmd: MHI command ring configurations table318 * @mhi_cmd: MHI command ring configurations table
315 * @mhi_ctxt: MHI device context, shared memory between host and device319 * @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 driver352 * 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 */
352struct mhi_controller {365struct 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;