gpu/drm: Create panelRegDA sysfs to expose panel's reg
Since ALS sensor's Firmware needs to keep track the PWM duty cycle of each panels' version, therefore the panels' register 0xDA will be used to identify the PWM duty cycle programmed in each panels' version. The new /sys/class/drm/card0-DSI1/panelRegDA sysfs will be created. Change-Id: I8abc7f31067614ce410348757aa8f75392788fb8 Signed-off-by: daiss1 <daiss1@lenovo.com> Reviewed-on: https://gerrit.mot.com/1514795 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Guobin Zhang <zhanggb@motorola.com> Submit-Approved: Jira Key Reviewed-on: https://gerrit.mot.com/1583968 Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
This commit is contained in:
1 parent
e6dfda2e39
commit
26d9c731a0
3 files changed
+28
-6
No files matched your search
@@ -234,13 +234,14 @@ static ssize_t panelId_show(struct device *device,
|
||||
char *buf)
|
||||
{
|
||||
struct drm_connector *connector = to_drm_connector(device);
|
||||
int written = 0;
|
||||
|
||||
mutex_lock(&connector->dev->mode_config.mutex);
|
||||
snprintf(buf, PAGE_SIZE, "0x%016llx\n",
|
||||
written = snprintf(buf, PAGE_SIZE, "0x%016llx\n",
|
||||
connector->display_info.panel_id);
|
||||
mutex_unlock(&connector->dev->mode_config.mutex);
|
||||
|
||||
return 20;
|
||||
return written;
|
||||
}
|
||||
|
||||
static ssize_t panelVer_show(struct device *device,
|
||||
@@ -248,13 +249,14 @@ static ssize_t panelVer_show(struct device *device,
|
||||
char *buf)
|
||||
{
|
||||
struct drm_connector *connector = to_drm_connector(device);
|
||||
int written = 0;
|
||||
|
||||
mutex_lock(&connector->dev->mode_config.mutex);
|
||||
snprintf(buf, PAGE_SIZE, "0x%016llx\n",
|
||||
written = snprintf(buf, PAGE_SIZE, "0x%016llx\n",
|
||||
connector->display_info.panel_ver);
|
||||
mutex_unlock(&connector->dev->mode_config.mutex);
|
||||
|
||||
return 20;
|
||||
return written;
|
||||
}
|
||||
|
||||
static ssize_t panelName_show(struct device *device,
|
||||
@@ -262,14 +264,30 @@ static ssize_t panelName_show(struct device *device,
|
||||
char *buf)
|
||||
{
|
||||
struct drm_connector *connector = to_drm_connector(device);
|
||||
int written = 0;
|
||||
|
||||
mutex_lock(&connector->dev->mode_config.mutex);
|
||||
snprintf(buf, PAGE_SIZE, "%s\n", connector->display_info.panel_name);
|
||||
written = snprintf(buf, PAGE_SIZE, "%s\n", connector->display_info.panel_name);
|
||||
mutex_unlock(&connector->dev->mode_config.mutex);
|
||||
|
||||
return sizeof(connector->display_info.panel_name);
|
||||
return written;
|
||||
}
|
||||
|
||||
static ssize_t panelRegDA_show(struct device *device,
|
||||
struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
struct drm_connector *connector = to_drm_connector(device);
|
||||
int written = 0;
|
||||
|
||||
mutex_lock(&connector->dev->mode_config.mutex);
|
||||
written = snprintf(buf, PAGE_SIZE, "0x%02x\n", connector->display_info.panel_regDA);
|
||||
mutex_unlock(&connector->dev->mode_config.mutex);
|
||||
|
||||
return written;
|
||||
}
|
||||
|
||||
|
||||
static DEVICE_ATTR_RW(status);
|
||||
static DEVICE_ATTR_RO(enabled);
|
||||
static DEVICE_ATTR_RO(dpms);
|
||||
@@ -277,6 +295,7 @@ static DEVICE_ATTR_RO(modes);
|
||||
static DEVICE_ATTR_RO(panelId);
|
||||
static DEVICE_ATTR_RO(panelVer);
|
||||
static DEVICE_ATTR_RO(panelName);
|
||||
static DEVICE_ATTR_RO(panelRegDA);
|
||||
|
||||
|
||||
static struct attribute *connector_dev_attrs[] = {
|
||||
@@ -287,6 +306,7 @@ static struct attribute *connector_dev_attrs[] = {
|
||||
&dev_attr_panelId.attr,
|
||||
&dev_attr_panelVer.attr,
|
||||
&dev_attr_panelName.attr,
|
||||
&dev_attr_panelRegDA.attr,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
@@ -270,6 +270,7 @@ struct drm_display_info {
|
||||
|
||||
u64 panel_id;
|
||||
u64 panel_ver;
|
||||
u32 panel_regDA;
|
||||
char panel_name[DRM_DISPLAY_NAME_LEN];
|
||||
|
||||
|
||||
|
||||
@@ -290,6 +290,7 @@ struct drm_display_mode {
|
||||
|
||||
u64 panel_id;
|
||||
u64 panel_ver;
|
||||
u32 panel_regDA;
|
||||
char panel_name[DRM_MODE_DISPLAY_NAME_LEN];
|
||||
/**
|
||||
* @flags:
|
||||
|
||||
Reference in new issue
Block a user