Lines Matching refs:res
96 struct hdmi_resources res; member
499 struct hdmi_resources *res = &hdev->res; in hdmi_streamon() local
536 clk_disable(res->sclk_hdmi); in hdmi_streamon()
537 clk_set_parent(res->sclk_hdmi, res->sclk_hdmiphy); in hdmi_streamon()
538 clk_enable(res->sclk_hdmi); in hdmi_streamon()
550 struct hdmi_resources *res = &hdev->res; in hdmi_streamoff() local
558 clk_disable(res->sclk_hdmi); in hdmi_streamoff()
559 clk_set_parent(res->sclk_hdmi, res->sclk_pixel); in hdmi_streamoff()
560 clk_enable(res->sclk_hdmi); in hdmi_streamoff()
580 static int hdmi_resource_poweron(struct hdmi_resources *res) in hdmi_resource_poweron() argument
585 ret = regulator_bulk_enable(res->regul_count, res->regul_bulk); in hdmi_resource_poweron()
589 clk_enable(res->hdmiphy); in hdmi_resource_poweron()
591 clk_set_parent(res->sclk_hdmi, res->sclk_pixel); in hdmi_resource_poweron()
593 clk_enable(res->sclk_hdmi); in hdmi_resource_poweron()
598 static void hdmi_resource_poweroff(struct hdmi_resources *res) in hdmi_resource_poweroff() argument
601 clk_disable(res->sclk_hdmi); in hdmi_resource_poweroff()
603 clk_disable(res->hdmiphy); in hdmi_resource_poweroff()
605 regulator_bulk_disable(res->regul_count, res->regul_bulk); in hdmi_resource_poweroff()
736 hdmi_resource_poweroff(&hdev->res); in hdmi_runtime_suspend()
750 ret = hdmi_resource_poweron(&hdev->res); in hdmi_runtime_resume()
764 hdmi_resource_poweroff(&hdev->res); in hdmi_runtime_resume()
775 static void hdmi_resource_clear_clocks(struct hdmi_resources *res) in hdmi_resource_clear_clocks() argument
777 res->hdmi = ERR_PTR(-EINVAL); in hdmi_resource_clear_clocks()
778 res->sclk_hdmi = ERR_PTR(-EINVAL); in hdmi_resource_clear_clocks()
779 res->sclk_pixel = ERR_PTR(-EINVAL); in hdmi_resource_clear_clocks()
780 res->sclk_hdmiphy = ERR_PTR(-EINVAL); in hdmi_resource_clear_clocks()
781 res->hdmiphy = ERR_PTR(-EINVAL); in hdmi_resource_clear_clocks()
786 struct hdmi_resources *res = &hdev->res; in hdmi_resources_cleanup() local
790 if (res->regul_count) in hdmi_resources_cleanup()
791 regulator_bulk_free(res->regul_count, res->regul_bulk); in hdmi_resources_cleanup()
793 kfree(res->regul_bulk); in hdmi_resources_cleanup()
794 if (!IS_ERR(res->hdmiphy)) in hdmi_resources_cleanup()
795 clk_put(res->hdmiphy); in hdmi_resources_cleanup()
796 if (!IS_ERR(res->sclk_hdmiphy)) in hdmi_resources_cleanup()
797 clk_put(res->sclk_hdmiphy); in hdmi_resources_cleanup()
798 if (!IS_ERR(res->sclk_pixel)) in hdmi_resources_cleanup()
799 clk_put(res->sclk_pixel); in hdmi_resources_cleanup()
800 if (!IS_ERR(res->sclk_hdmi)) in hdmi_resources_cleanup()
801 clk_put(res->sclk_hdmi); in hdmi_resources_cleanup()
802 if (!IS_ERR(res->hdmi)) in hdmi_resources_cleanup()
803 clk_put(res->hdmi); in hdmi_resources_cleanup()
804 memset(res, 0, sizeof(*res)); in hdmi_resources_cleanup()
805 hdmi_resource_clear_clocks(res); in hdmi_resources_cleanup()
811 struct hdmi_resources *res = &hdev->res; in hdmi_resources_init() local
822 memset(res, 0, sizeof(*res)); in hdmi_resources_init()
823 hdmi_resource_clear_clocks(res); in hdmi_resources_init()
826 res->hdmi = clk_get(dev, "hdmi"); in hdmi_resources_init()
827 if (IS_ERR(res->hdmi)) { in hdmi_resources_init()
831 res->sclk_hdmi = clk_get(dev, "sclk_hdmi"); in hdmi_resources_init()
832 if (IS_ERR(res->sclk_hdmi)) { in hdmi_resources_init()
836 res->sclk_pixel = clk_get(dev, "sclk_pixel"); in hdmi_resources_init()
837 if (IS_ERR(res->sclk_pixel)) { in hdmi_resources_init()
841 res->sclk_hdmiphy = clk_get(dev, "sclk_hdmiphy"); in hdmi_resources_init()
842 if (IS_ERR(res->sclk_hdmiphy)) { in hdmi_resources_init()
846 res->hdmiphy = clk_get(dev, "hdmiphy"); in hdmi_resources_init()
847 if (IS_ERR(res->hdmiphy)) { in hdmi_resources_init()
851 res->regul_bulk = kcalloc(ARRAY_SIZE(supply), in hdmi_resources_init()
852 sizeof(res->regul_bulk[0]), GFP_KERNEL); in hdmi_resources_init()
853 if (!res->regul_bulk) { in hdmi_resources_init()
858 res->regul_bulk[i].supply = supply[i]; in hdmi_resources_init()
859 res->regul_bulk[i].consumer = NULL; in hdmi_resources_init()
862 ret = regulator_bulk_get(dev, ARRAY_SIZE(supply), res->regul_bulk); in hdmi_resources_init()
867 res->regul_count = ARRAY_SIZE(supply); in hdmi_resources_init()
879 struct resource *res; in hdmi_probe() local
908 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); in hdmi_probe()
909 if (res == NULL) { in hdmi_probe()
915 hdmi_dev->regs = devm_ioremap(&pdev->dev, res->start, in hdmi_probe()
916 resource_size(res)); in hdmi_probe()
923 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); in hdmi_probe()
924 if (res == NULL) { in hdmi_probe()
930 ret = devm_request_irq(&pdev->dev, res->start, hdmi_irq_handler, 0, in hdmi_probe()
936 hdmi_dev->irq = res->start; in hdmi_probe()
993 clk_enable(hdmi_dev->res.hdmi); in hdmi_probe()
1034 clk_disable(hdmi_dev->res.hdmi); in hdmi_remove()