diff options
author | james qian wang (Arm Technology China) <james.qian.wang@arm.com> | 2019-01-22 11:11:53 +0000 |
---|---|---|
committer | Liviu Dudau <Liviu.Dudau@arm.com> | 2019-05-07 11:20:28 +0100 |
commit | 55223394d56bab42ebac71ba52e0fd8bfdc6fc07 (patch) | |
tree | d6b16752e9f4bcee256eeab9be7281eb328d5a25 /drivers/gpu/drm/arm/display/komeda/komeda_drv.c | |
parent | 42c729418d9ce8f212ee691a8a91d93bfe9f34de (diff) | |
download | linux-rt-55223394d56bab42ebac71ba52e0fd8bfdc6fc07.tar.gz |
drm/komeda: Add sysfs attribute: core_id and config_id
Add two sysfs node: core_id, config_id, user can read them to fetch the
HW product information.
Also, use memset to initialize config_id, rather than quirky C syntax.
Courtesy of Nathan Chancellor <natechancellor@gmail.com>.
Signed-off-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
[Merged Nathan's patch that uses memset to initialize config_id into
original patch as the fixes tag changed due to rebase, reworded the
commit to reference the merged patch]
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
Diffstat (limited to 'drivers/gpu/drm/arm/display/komeda/komeda_drv.c')
-rw-r--r-- | drivers/gpu/drm/arm/display/komeda/komeda_drv.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_drv.c b/drivers/gpu/drm/arm/display/komeda/komeda_drv.c index 2bdd189b041d..0285fd37a016 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_drv.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_drv.c @@ -17,6 +17,13 @@ struct komeda_drv { struct komeda_kms_dev *kms; }; +struct komeda_dev *dev_to_mdev(struct device *dev) +{ + struct komeda_drv *mdrv = dev_get_drvdata(dev); + + return mdrv ? mdrv->mdev : NULL; +} + static void komeda_unbind(struct device *dev) { struct komeda_drv *mdrv = dev_get_drvdata(dev); |