Skip to content

Commit 6334786

Browse files
SlarkXiaoMani-Sadhasivam
authored andcommitted
bus: mhi: host: Allow controller drivers to specify name for the MHI controller
MHI devices usually have a product/device name to identify each device uniquely. So let's specify that name in 'struct mhi_controller' so that the client drivers can use this name to uniquely identify the devices and apply any device specific quirks. Signed-off-by: Slark Xiao <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]> Link: https://lore.kernel.org/r/[email protected] [mani: reworked subject and description] Signed-off-by: Manivannan Sadhasivam <[email protected]>
1 parent bf30a75 commit 6334786

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

drivers/bus/mhi/host/pci_generic.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,6 +1086,7 @@ static int mhi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
10861086
mhi_cntrl->runtime_get = mhi_pci_runtime_get;
10871087
mhi_cntrl->runtime_put = mhi_pci_runtime_put;
10881088
mhi_cntrl->mru = info->mru_default;
1089+
mhi_cntrl->name = info->name;
10891090

10901091
if (info->edl_trigger)
10911092
mhi_cntrl->edl_trigger = mhi_pci_generic_edl_trigger;

include/linux/mhi.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ struct mhi_controller_config {
290290

291291
/**
292292
* struct mhi_controller - Master MHI controller structure
293+
* @name: Device name of the MHI controller
293294
* @cntrl_dev: Pointer to the struct device of physical bus acting as the MHI
294295
* controller (required)
295296
* @mhi_dev: MHI device instance for the controller
@@ -367,6 +368,7 @@ struct mhi_controller_config {
367368
* they can be populated depending on the usecase.
368369
*/
369370
struct mhi_controller {
371+
const char *name;
370372
struct device *cntrl_dev;
371373
struct mhi_device *mhi_dev;
372374
struct dentry *debugfs_dentry;

0 commit comments

Comments
 (0)