static ssize_t nvsd_registers_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { struct device *dev = container_of((kobj->parent), struct device, kobj); struct nvhost_device *ndev = to_nvhost_device(dev); struct tegra_dc *dc = nvhost_get_drvdata(ndev); ssize_t res = 0; mutex_lock(&dc->lock); if (!dc->enabled) { mutex_unlock(&dc->lock); return -ENODEV; } mutex_unlock(&dc->lock); NVSD_PRINT_REG(DC_DISP_SD_CONTROL); NVSD_PRINT_REG(DC_DISP_SD_CSC_COEFF); NVSD_PRINT_REG_ARRAY(DC_DISP_SD_LUT); NVSD_PRINT_REG(DC_DISP_SD_FLICKER_CONTROL); NVSD_PRINT_REG(DC_DISP_SD_PIXEL_COUNT); NVSD_PRINT_REG_ARRAY(DC_DISP_SD_HISTOGRAM); NVSD_PRINT_REG(DC_DISP_SD_BL_PARAMETERS); NVSD_PRINT_REG_ARRAY(DC_DISP_SD_BL_TF); NVSD_PRINT_REG(DC_DISP_SD_BL_CONTROL); NVSD_PRINT_REG(DC_DISP_SD_HW_K_VALUES); NVSD_PRINT_REG(DC_DISP_SD_MAN_K_VALUES); return res; }
static ssize_t nvsd_registers_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { struct device *dev = container_of((kobj->parent), struct device, kobj); struct nvhost_device *ndev = to_nvhost_device(dev); struct tegra_dc *dc = nvhost_get_drvdata(ndev); ssize_t res = 0; clk_enable(dc->clk); tegra_dc_io_start(dc); mutex_lock(&dc->lock); if (!dc->enabled) { mutex_unlock(&dc->lock); return -ENODEV; } mutex_unlock(&dc->lock); NVSD_PRINT_REG(DC_DISP_SD_CONTROL); NVSD_PRINT_REG(DC_DISP_SD_CSC_COEFF); NVSD_PRINT_REG_ARRAY(DC_DISP_SD_LUT); NVSD_PRINT_REG(DC_DISP_SD_FLICKER_CONTROL); NVSD_PRINT_REG(DC_DISP_SD_PIXEL_COUNT); NVSD_PRINT_REG_ARRAY(DC_DISP_SD_HISTOGRAM); NVSD_PRINT_REG(DC_DISP_SD_BL_PARAMETERS); NVSD_PRINT_REG_ARRAY(DC_DISP_SD_BL_TF); NVSD_PRINT_REG(DC_DISP_SD_BL_CONTROL); NVSD_PRINT_REG(DC_DISP_SD_HW_K_VALUES); NVSD_PRINT_REG(DC_DISP_SD_MAN_K_VALUES); #ifdef CONFIG_TEGRA_SD_GEN2 NVSD_PRINT_REG(DC_DISP_SD_K_LIMIT); NVSD_PRINT_REG(DC_DISP_SD_WINDOW_POSITION); NVSD_PRINT_REG(DC_DISP_SD_WINDOW_SIZE); NVSD_PRINT_REG(DC_DISP_SD_SOFT_CLIPPING); NVSD_PRINT_REG(DC_DISP_SD_SMOOTH_K); #endif tegra_dc_io_end(dc); clk_disable(dc->clk); return res; }