Loading drivers/gpu/drm/nouveau/dispnv04/dac.c +6 −6 Original line number Diff line number Diff line Loading @@ -270,10 +270,10 @@ uint32_t nv17_dac_sample_load(struct drm_encoder *encoder) } if (gpio) { saved_gpio1 = gpio->get(gpio, 0, DCB_GPIO_TVDAC1, 0xff); saved_gpio0 = gpio->get(gpio, 0, DCB_GPIO_TVDAC0, 0xff); gpio->set(gpio, 0, DCB_GPIO_TVDAC1, 0xff, dcb->type == DCB_OUTPUT_TV); gpio->set(gpio, 0, DCB_GPIO_TVDAC0, 0xff, dcb->type == DCB_OUTPUT_TV); saved_gpio1 = nvkm_gpio_get(gpio, 0, DCB_GPIO_TVDAC1, 0xff); saved_gpio0 = nvkm_gpio_get(gpio, 0, DCB_GPIO_TVDAC0, 0xff); nvkm_gpio_set(gpio, 0, DCB_GPIO_TVDAC1, 0xff, dcb->type == DCB_OUTPUT_TV); nvkm_gpio_set(gpio, 0, DCB_GPIO_TVDAC0, 0xff, dcb->type == DCB_OUTPUT_TV); } msleep(4); Loading Loading @@ -325,8 +325,8 @@ uint32_t nv17_dac_sample_load(struct drm_encoder *encoder) nvif_wr32(device, NV_PBUS_POWERCTRL_2, saved_powerctrl_2); if (gpio) { gpio->set(gpio, 0, DCB_GPIO_TVDAC1, 0xff, saved_gpio1); gpio->set(gpio, 0, DCB_GPIO_TVDAC0, 0xff, saved_gpio0); nvkm_gpio_set(gpio, 0, DCB_GPIO_TVDAC1, 0xff, saved_gpio1); nvkm_gpio_set(gpio, 0, DCB_GPIO_TVDAC0, 0xff, saved_gpio0); } return sample; Loading drivers/gpu/drm/nouveau/dispnv04/tvnv17.c +8 −8 Original line number Diff line number Diff line Loading @@ -62,8 +62,8 @@ static uint32_t nv42_tv_sample_load(struct drm_encoder *encoder) head = (dacclk & 0x100) >> 8; /* Save the previous state. */ gpio1 = gpio->get(gpio, 0, DCB_GPIO_TVDAC1, 0xff); gpio0 = gpio->get(gpio, 0, DCB_GPIO_TVDAC0, 0xff); gpio1 = nvkm_gpio_get(gpio, 0, DCB_GPIO_TVDAC1, 0xff); gpio0 = nvkm_gpio_get(gpio, 0, DCB_GPIO_TVDAC0, 0xff); fp_htotal = NVReadRAMDAC(dev, head, NV_PRAMDAC_FP_HTOTAL); fp_hsync_start = NVReadRAMDAC(dev, head, NV_PRAMDAC_FP_HSYNC_START); fp_hsync_end = NVReadRAMDAC(dev, head, NV_PRAMDAC_FP_HSYNC_END); Loading @@ -74,8 +74,8 @@ static uint32_t nv42_tv_sample_load(struct drm_encoder *encoder) ctv_6c = NVReadRAMDAC(dev, head, 0x680c6c); /* Prepare the DAC for load detection. */ gpio->set(gpio, 0, DCB_GPIO_TVDAC1, 0xff, true); gpio->set(gpio, 0, DCB_GPIO_TVDAC0, 0xff, true); nvkm_gpio_set(gpio, 0, DCB_GPIO_TVDAC1, 0xff, true); nvkm_gpio_set(gpio, 0, DCB_GPIO_TVDAC0, 0xff, true); NVWriteRAMDAC(dev, head, NV_PRAMDAC_FP_HTOTAL, 1343); NVWriteRAMDAC(dev, head, NV_PRAMDAC_FP_HSYNC_START, 1047); Loading Loading @@ -120,8 +120,8 @@ static uint32_t nv42_tv_sample_load(struct drm_encoder *encoder) NVWriteRAMDAC(dev, head, NV_PRAMDAC_FP_HSYNC_END, fp_hsync_end); NVWriteRAMDAC(dev, head, NV_PRAMDAC_FP_HSYNC_START, fp_hsync_start); NVWriteRAMDAC(dev, head, NV_PRAMDAC_FP_HTOTAL, fp_htotal); gpio->set(gpio, 0, DCB_GPIO_TVDAC1, 0xff, gpio1); gpio->set(gpio, 0, DCB_GPIO_TVDAC0, 0xff, gpio0); nvkm_gpio_set(gpio, 0, DCB_GPIO_TVDAC1, 0xff, gpio1); nvkm_gpio_set(gpio, 0, DCB_GPIO_TVDAC0, 0xff, gpio0); return sample; } Loading Loading @@ -395,8 +395,8 @@ static void nv17_tv_dpms(struct drm_encoder *encoder, int mode) nv_load_ptv(dev, regs, 200); gpio->set(gpio, 0, DCB_GPIO_TVDAC1, 0xff, mode == DRM_MODE_DPMS_ON); gpio->set(gpio, 0, DCB_GPIO_TVDAC0, 0xff, mode == DRM_MODE_DPMS_ON); nvkm_gpio_set(gpio, 0, DCB_GPIO_TVDAC1, 0xff, mode == DRM_MODE_DPMS_ON); nvkm_gpio_set(gpio, 0, DCB_GPIO_TVDAC0, 0xff, mode == DRM_MODE_DPMS_ON); nv04_dac_update_dacclk(encoder, mode == DRM_MODE_DPMS_ON); } Loading drivers/gpu/drm/nouveau/include/nvif/device.h +1 −1 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ u64 nvif_device_time(struct nvif_device *); #define nvxx_fb(a) nvxx_device(a)->fb #define nvxx_mmu(a) nvkm_mmu(nvxx_device(a)) #define nvxx_bar(a) nvxx_device(a)->bar #define nvxx_gpio(a) nvkm_gpio(nvxx_device(a)) #define nvxx_gpio(a) nvxx_device(a)->gpio #define nvxx_clk(a) nvxx_device(a)->clk #define nvxx_i2c(a) nvkm_i2c(nvxx_device(a)) #define nvxx_therm(a) nvkm_therm(nvxx_device(a)) Loading drivers/gpu/drm/nouveau/include/nvkm/subdev/gpio.h +12 −17 Original line number Diff line number Diff line Loading @@ -19,26 +19,21 @@ struct nvkm_gpio_ntfy_rep { }; struct nvkm_gpio { const struct nvkm_gpio_func *func; struct nvkm_subdev subdev; struct nvkm_event event; void (*reset)(struct nvkm_gpio *, u8 func); int (*find)(struct nvkm_gpio *, int idx, u8 tag, u8 line, struct dcb_gpio_func *); int (*set)(struct nvkm_gpio *, int idx, u8 tag, u8 line, int state); int (*get)(struct nvkm_gpio *, int idx, u8 tag, u8 line); }; static inline struct nvkm_gpio * nvkm_gpio(void *obj) { return (void *)nvkm_subdev(obj, NVDEV_SUBDEV_GPIO); } extern struct nvkm_oclass *nv10_gpio_oclass; extern struct nvkm_oclass *nv50_gpio_oclass; extern struct nvkm_oclass *g94_gpio_oclass; extern struct nvkm_oclass *gf110_gpio_oclass; extern struct nvkm_oclass *gk104_gpio_oclass; void nvkm_gpio_reset(struct nvkm_gpio *, u8 func); int nvkm_gpio_find(struct nvkm_gpio *, int idx, u8 tag, u8 line, struct dcb_gpio_func *); int nvkm_gpio_set(struct nvkm_gpio *, int idx, u8 tag, u8 line, int state); int nvkm_gpio_get(struct nvkm_gpio *, int idx, u8 tag, u8 line); int nv10_gpio_new(struct nvkm_device *, int, struct nvkm_gpio **); int nv50_gpio_new(struct nvkm_device *, int, struct nvkm_gpio **); int g94_gpio_new(struct nvkm_device *, int, struct nvkm_gpio **); int gf119_gpio_new(struct nvkm_device *, int, struct nvkm_gpio **); int gk104_gpio_new(struct nvkm_device *, int, struct nvkm_gpio **); #endif drivers/gpu/drm/nouveau/nouveau_connector.c +3 −3 Original line number Diff line number Diff line Loading @@ -125,9 +125,9 @@ nouveau_connector_ddc_detect(struct drm_connector *connector) * is handled by the SOR itself, and not required for LVDS DDC. */ if (nv_connector->type == DCB_CONNECTOR_eDP) { panel = gpio->get(gpio, 0, DCB_GPIO_PANEL_POWER, 0xff); panel = nvkm_gpio_get(gpio, 0, DCB_GPIO_PANEL_POWER, 0xff); if (panel == 0) { gpio->set(gpio, 0, DCB_GPIO_PANEL_POWER, 0xff, 1); nvkm_gpio_set(gpio, 0, DCB_GPIO_PANEL_POWER, 0xff, 1); msleep(300); } } Loading Loading @@ -157,7 +157,7 @@ nouveau_connector_ddc_detect(struct drm_connector *connector) * state to avoid confusing the SOR for other output types. */ if (!nv_encoder && panel == 0) gpio->set(gpio, 0, DCB_GPIO_PANEL_POWER, 0xff, panel); nvkm_gpio_set(gpio, 0, DCB_GPIO_PANEL_POWER, 0xff, panel); return nv_encoder; } Loading Loading
drivers/gpu/drm/nouveau/dispnv04/dac.c +6 −6 Original line number Diff line number Diff line Loading @@ -270,10 +270,10 @@ uint32_t nv17_dac_sample_load(struct drm_encoder *encoder) } if (gpio) { saved_gpio1 = gpio->get(gpio, 0, DCB_GPIO_TVDAC1, 0xff); saved_gpio0 = gpio->get(gpio, 0, DCB_GPIO_TVDAC0, 0xff); gpio->set(gpio, 0, DCB_GPIO_TVDAC1, 0xff, dcb->type == DCB_OUTPUT_TV); gpio->set(gpio, 0, DCB_GPIO_TVDAC0, 0xff, dcb->type == DCB_OUTPUT_TV); saved_gpio1 = nvkm_gpio_get(gpio, 0, DCB_GPIO_TVDAC1, 0xff); saved_gpio0 = nvkm_gpio_get(gpio, 0, DCB_GPIO_TVDAC0, 0xff); nvkm_gpio_set(gpio, 0, DCB_GPIO_TVDAC1, 0xff, dcb->type == DCB_OUTPUT_TV); nvkm_gpio_set(gpio, 0, DCB_GPIO_TVDAC0, 0xff, dcb->type == DCB_OUTPUT_TV); } msleep(4); Loading Loading @@ -325,8 +325,8 @@ uint32_t nv17_dac_sample_load(struct drm_encoder *encoder) nvif_wr32(device, NV_PBUS_POWERCTRL_2, saved_powerctrl_2); if (gpio) { gpio->set(gpio, 0, DCB_GPIO_TVDAC1, 0xff, saved_gpio1); gpio->set(gpio, 0, DCB_GPIO_TVDAC0, 0xff, saved_gpio0); nvkm_gpio_set(gpio, 0, DCB_GPIO_TVDAC1, 0xff, saved_gpio1); nvkm_gpio_set(gpio, 0, DCB_GPIO_TVDAC0, 0xff, saved_gpio0); } return sample; Loading
drivers/gpu/drm/nouveau/dispnv04/tvnv17.c +8 −8 Original line number Diff line number Diff line Loading @@ -62,8 +62,8 @@ static uint32_t nv42_tv_sample_load(struct drm_encoder *encoder) head = (dacclk & 0x100) >> 8; /* Save the previous state. */ gpio1 = gpio->get(gpio, 0, DCB_GPIO_TVDAC1, 0xff); gpio0 = gpio->get(gpio, 0, DCB_GPIO_TVDAC0, 0xff); gpio1 = nvkm_gpio_get(gpio, 0, DCB_GPIO_TVDAC1, 0xff); gpio0 = nvkm_gpio_get(gpio, 0, DCB_GPIO_TVDAC0, 0xff); fp_htotal = NVReadRAMDAC(dev, head, NV_PRAMDAC_FP_HTOTAL); fp_hsync_start = NVReadRAMDAC(dev, head, NV_PRAMDAC_FP_HSYNC_START); fp_hsync_end = NVReadRAMDAC(dev, head, NV_PRAMDAC_FP_HSYNC_END); Loading @@ -74,8 +74,8 @@ static uint32_t nv42_tv_sample_load(struct drm_encoder *encoder) ctv_6c = NVReadRAMDAC(dev, head, 0x680c6c); /* Prepare the DAC for load detection. */ gpio->set(gpio, 0, DCB_GPIO_TVDAC1, 0xff, true); gpio->set(gpio, 0, DCB_GPIO_TVDAC0, 0xff, true); nvkm_gpio_set(gpio, 0, DCB_GPIO_TVDAC1, 0xff, true); nvkm_gpio_set(gpio, 0, DCB_GPIO_TVDAC0, 0xff, true); NVWriteRAMDAC(dev, head, NV_PRAMDAC_FP_HTOTAL, 1343); NVWriteRAMDAC(dev, head, NV_PRAMDAC_FP_HSYNC_START, 1047); Loading Loading @@ -120,8 +120,8 @@ static uint32_t nv42_tv_sample_load(struct drm_encoder *encoder) NVWriteRAMDAC(dev, head, NV_PRAMDAC_FP_HSYNC_END, fp_hsync_end); NVWriteRAMDAC(dev, head, NV_PRAMDAC_FP_HSYNC_START, fp_hsync_start); NVWriteRAMDAC(dev, head, NV_PRAMDAC_FP_HTOTAL, fp_htotal); gpio->set(gpio, 0, DCB_GPIO_TVDAC1, 0xff, gpio1); gpio->set(gpio, 0, DCB_GPIO_TVDAC0, 0xff, gpio0); nvkm_gpio_set(gpio, 0, DCB_GPIO_TVDAC1, 0xff, gpio1); nvkm_gpio_set(gpio, 0, DCB_GPIO_TVDAC0, 0xff, gpio0); return sample; } Loading Loading @@ -395,8 +395,8 @@ static void nv17_tv_dpms(struct drm_encoder *encoder, int mode) nv_load_ptv(dev, regs, 200); gpio->set(gpio, 0, DCB_GPIO_TVDAC1, 0xff, mode == DRM_MODE_DPMS_ON); gpio->set(gpio, 0, DCB_GPIO_TVDAC0, 0xff, mode == DRM_MODE_DPMS_ON); nvkm_gpio_set(gpio, 0, DCB_GPIO_TVDAC1, 0xff, mode == DRM_MODE_DPMS_ON); nvkm_gpio_set(gpio, 0, DCB_GPIO_TVDAC0, 0xff, mode == DRM_MODE_DPMS_ON); nv04_dac_update_dacclk(encoder, mode == DRM_MODE_DPMS_ON); } Loading
drivers/gpu/drm/nouveau/include/nvif/device.h +1 −1 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ u64 nvif_device_time(struct nvif_device *); #define nvxx_fb(a) nvxx_device(a)->fb #define nvxx_mmu(a) nvkm_mmu(nvxx_device(a)) #define nvxx_bar(a) nvxx_device(a)->bar #define nvxx_gpio(a) nvkm_gpio(nvxx_device(a)) #define nvxx_gpio(a) nvxx_device(a)->gpio #define nvxx_clk(a) nvxx_device(a)->clk #define nvxx_i2c(a) nvkm_i2c(nvxx_device(a)) #define nvxx_therm(a) nvkm_therm(nvxx_device(a)) Loading
drivers/gpu/drm/nouveau/include/nvkm/subdev/gpio.h +12 −17 Original line number Diff line number Diff line Loading @@ -19,26 +19,21 @@ struct nvkm_gpio_ntfy_rep { }; struct nvkm_gpio { const struct nvkm_gpio_func *func; struct nvkm_subdev subdev; struct nvkm_event event; void (*reset)(struct nvkm_gpio *, u8 func); int (*find)(struct nvkm_gpio *, int idx, u8 tag, u8 line, struct dcb_gpio_func *); int (*set)(struct nvkm_gpio *, int idx, u8 tag, u8 line, int state); int (*get)(struct nvkm_gpio *, int idx, u8 tag, u8 line); }; static inline struct nvkm_gpio * nvkm_gpio(void *obj) { return (void *)nvkm_subdev(obj, NVDEV_SUBDEV_GPIO); } extern struct nvkm_oclass *nv10_gpio_oclass; extern struct nvkm_oclass *nv50_gpio_oclass; extern struct nvkm_oclass *g94_gpio_oclass; extern struct nvkm_oclass *gf110_gpio_oclass; extern struct nvkm_oclass *gk104_gpio_oclass; void nvkm_gpio_reset(struct nvkm_gpio *, u8 func); int nvkm_gpio_find(struct nvkm_gpio *, int idx, u8 tag, u8 line, struct dcb_gpio_func *); int nvkm_gpio_set(struct nvkm_gpio *, int idx, u8 tag, u8 line, int state); int nvkm_gpio_get(struct nvkm_gpio *, int idx, u8 tag, u8 line); int nv10_gpio_new(struct nvkm_device *, int, struct nvkm_gpio **); int nv50_gpio_new(struct nvkm_device *, int, struct nvkm_gpio **); int g94_gpio_new(struct nvkm_device *, int, struct nvkm_gpio **); int gf119_gpio_new(struct nvkm_device *, int, struct nvkm_gpio **); int gk104_gpio_new(struct nvkm_device *, int, struct nvkm_gpio **); #endif
drivers/gpu/drm/nouveau/nouveau_connector.c +3 −3 Original line number Diff line number Diff line Loading @@ -125,9 +125,9 @@ nouveau_connector_ddc_detect(struct drm_connector *connector) * is handled by the SOR itself, and not required for LVDS DDC. */ if (nv_connector->type == DCB_CONNECTOR_eDP) { panel = gpio->get(gpio, 0, DCB_GPIO_PANEL_POWER, 0xff); panel = nvkm_gpio_get(gpio, 0, DCB_GPIO_PANEL_POWER, 0xff); if (panel == 0) { gpio->set(gpio, 0, DCB_GPIO_PANEL_POWER, 0xff, 1); nvkm_gpio_set(gpio, 0, DCB_GPIO_PANEL_POWER, 0xff, 1); msleep(300); } } Loading Loading @@ -157,7 +157,7 @@ nouveau_connector_ddc_detect(struct drm_connector *connector) * state to avoid confusing the SOR for other output types. */ if (!nv_encoder && panel == 0) gpio->set(gpio, 0, DCB_GPIO_PANEL_POWER, 0xff, panel); nvkm_gpio_set(gpio, 0, DCB_GPIO_PANEL_POWER, 0xff, panel); return nv_encoder; } Loading