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
310310 * @sw_ev_rings: Number of software event rings
311311 * @nr_irqs_req: Number of IRQs required to operate (optional)
312312 * @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
313317 * @mhi_event: MHI event ring configurations table
314318 * @mhi_cmd: MHI command ring configurations table
315319 * @mhi_ctxt: MHI device context, shared memory between host and device
@@ -348,6 +352,15 @@ struct mhi_controller_config { · 32 unmodified lines
348352 * Fields marked as (required) need to be populated by the controller driver
349353 * before calling mhi_register_controller(). For the fields marked as (optional)
350354 * 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
351364 */
352365 struct mhi_controller {
353366 struct device *cntrl_dev;
@@ -375,6 +388,10 @@ struct mhi_controller { · 21 unmodified lines
375388 u32 sw_ev_rings;
376389 u32 nr_irqs_req;
377390 u32 nr_irqs;
391+ u32 family_number;
392+ u32 device_number;
393+ u32 major_version;
394+ u32 minor_version;
378395
379396 struct mhi_event *mhi_event;
380397 struct mhi_cmd *mhi_cmd;