Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp4015173ybd; Tue, 25 Jun 2019 12:28:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqyv7wbv/UsZpOA2N19IVFaZZnJJlC4qxR4OExQxZCZuLpUvXzMbPQdUacyVwHwPRNytTFlK X-Received: by 2002:a17:90a:d80b:: with SMTP id a11mr479376pjv.53.1561490919148; Tue, 25 Jun 2019 12:28:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561490919; cv=none; d=google.com; s=arc-20160816; b=Q3InpqPGIQBdm++w7HwXF1DxBMQvdyhplqH1VO41FvoIoIzzAgFckB2QueEaQFTKvM G4c4fcKRXbCqMem/smz3gIEBMxA4rqggZ8cxsx1yKhOsdo2c8dX6QLOEZ6b4qpYFAjds syPGcwKwRedd0zCDTZwjfCv4O8e86W9/3rH291MVGUSdL0CpYBwqmT7GtyHJZV3aT5Mq gRZOk4Abr3fQb5DIQL5l5xbmgKcpjSVQy3XSJO2tlot37E/AxQo1xV2RgDvCSMzhT4+m YeDxdRkV3DyA+BCHiueJtnAjGVX8Q1+SxSjO8U/NqhXXp6AM+yYeOM/Q7lTxjTchmk21 Kmyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=pPfiVDgc5mzijoolmBgAn7nj9hFIGXkNoey2vIeezPw=; b=WQ0K5L4R9i0UDUur95hBymu7kqsU923twQhkapXEjaKB5U0LWKZqVjJmA63ixpobAT n3HTo1w+yf628iffxNwuc5sBI1xivpYHKiafrcck552lhehN0k+p19dZs6pomfAFf65D BAzFQGODxzAdWd/XikEtQUc8geUO/1CcaicsPx4Y97Sz72LrOapjOB5bCKLcrWvSPcZ8 rFyEkmTz/RjZGhZMmGTx4XxDwdGf/Ngfjboayn5linFioH2htxUhOxJ5LftEKwdHK0At uGGV2qxWD2t/QIeINlOr/SdjhnrWavx6cTJKSl0qaRWkyUcjv7r4FDjlQD5spnR7yVV3 Qbfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=PH6PJoOt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a24si34672pju.32.2019.06.25.12.28.23; Tue, 25 Jun 2019 12:28:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=PH6PJoOt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731524AbfFYQfG (ORCPT + 99 others); Tue, 25 Jun 2019 12:35:06 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:39551 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730687AbfFYQfD (ORCPT ); Tue, 25 Jun 2019 12:35:03 -0400 Received: by mail-wm1-f65.google.com with SMTP id z23so3624378wma.4 for ; Tue, 25 Jun 2019 09:35:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pPfiVDgc5mzijoolmBgAn7nj9hFIGXkNoey2vIeezPw=; b=PH6PJoOty745v5HCYWGPCWBeeSNGmb9UwwqkfUOiMl1dAeUCOfW64MYeP65AJk34q9 QVGkrvI13TaiQUcKO3PAzYhR+SlYTOCGOCEmHOZl8pzZnDrgU3OgL2F4sF4t8Wuu45bI O0s/CEA9VySw6B9MT6SnlA85lLwIQMHTWKRdJ5dPWzlthv0Mp9kYKxLDYTI2NT9eAsHs 9Bzih0UeynmsFxiAwYLqO5DU6VEut6rYd9k7eNOqFJNdg09L0b6P5zp0kJwKKrUMpgTh 0ABqdJwysPXZFSMGHbolipLeMxh0463L8lROsmZybF2G0ckfGkRbbW/NOxebpA6Ut4Ft dJyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pPfiVDgc5mzijoolmBgAn7nj9hFIGXkNoey2vIeezPw=; b=Nx5KoCNsXB2jEOmoBovaAMjMQ+9iFAcRKId4TXvRJv9/VkjKYuwPOxo6eDoB/1n8TL CLayIpMIiARFoeS0xKu7xo7QUueGQFoEJCjbJ9wFm4oGLUGDijD0n2CZz0aszevziYkg K1HVzQPM0RoLGCw3SbNzBQclxFQAuu7QG+8UErvK+y6ArTfAg/EVyIC9kSxSXGDdNAYt +Sktkzfqzpr3XX2LDeVxZTPKrx63WhhDiQ5AM7cd9WNTqpq9LqaXwnV6CJO+6QlRQXnL jJCgHFXTE65ag94qb4WpoxcPifZ3NUzOQwThHD+lYh29F2MbnjCZ6eLYJxZ1LqB2W0Cy WAkw== X-Gm-Message-State: APjAAAVob+Ua4Q+CrY0nbHho1ydhRHhTAuYzu/Ke296ajs57r9s0UjKq c6j/X63TbiNU+czN4ln1Vxou9g== X-Received: by 2002:a1c:a842:: with SMTP id r63mr20223185wme.117.1561480501837; Tue, 25 Jun 2019 09:35:01 -0700 (PDT) Received: from debian-brgl.home ([2a01:cb1d:af:5b00:6d6c:8493:1ab5:dad7]) by smtp.gmail.com with ESMTPSA id g8sm2683795wme.20.2019.06.25.09.35.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Jun 2019 09:35:01 -0700 (PDT) From: Bartosz Golaszewski To: Sekhar Nori , Kevin Hilman , Lee Jones , Daniel Thompson , Jingoo Han , Bartlomiej Zolnierkiewicz , David Lechner , Linus Walleij Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 08/12] ARM: davinci: da850-evm: switch to using a fixed regulator for lcdc Date: Tue, 25 Jun 2019 18:34:30 +0200 Message-Id: <20190625163434.13620-9-brgl@bgdev.pl> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190625163434.13620-1-brgl@bgdev.pl> References: <20190625163434.13620-1-brgl@bgdev.pl> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bartosz Golaszewski Now that the da8xx fbdev driver supports power control with an actual regulator, switch to using a fixed power supply for da850-evm. Signed-off-by: Bartosz Golaszewski --- arch/arm/mach-davinci/board-da850-evm.c | 62 ++++++++++++++++++------- 1 file changed, 44 insertions(+), 18 deletions(-) diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index ffda623bb543..d26950f605f4 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c @@ -802,12 +802,6 @@ static const short da850_evm_mmcsd0_pins[] __initconst = { -1 }; -static void da850_panel_power_ctrl(int val) -{ - /* lcd power */ - gpio_set_value(DA850_LCD_PWR_PIN, val); -} - static struct property_entry da850_lcd_backlight_props[] = { PROPERTY_ENTRY_BOOL("default-on"), { } @@ -827,28 +821,61 @@ static const struct platform_device_info da850_lcd_backlight_info = { .properties = da850_lcd_backlight_props, }; +static struct regulator_consumer_supply da850_lcd_supplies[] = { + REGULATOR_SUPPLY("lcd", NULL), +}; + +static struct regulator_init_data da850_lcd_supply_data = { + .consumer_supplies = da850_lcd_supplies, + .num_consumer_supplies = ARRAY_SIZE(da850_lcd_supplies), + .constraints = { + .valid_ops_mask = REGULATOR_CHANGE_STATUS, + }, +}; + +static struct fixed_voltage_config da850_lcd_supply = { + .supply_name = "lcd", + .microvolts = 33000000, + .init_data = &da850_lcd_supply_data, +}; + +static struct platform_device da850_lcd_supply_device = { + .name = "reg-fixed-voltage", + .id = 1, /* Dummy fixed regulator is 0 */ + .dev = { + .platform_data = &da850_lcd_supply, + }, +}; + +static struct gpiod_lookup_table da850_lcd_supply_gpio_table = { + .dev_id = "reg-fixed-voltage.1", + .table = { + GPIO_LOOKUP("davinci_gpio", DA850_LCD_PWR_PIN, NULL, 0), + { } + }, +}; + +static struct gpiod_lookup_table *da850_lcd_gpio_lookups[] = { + &da850_lcd_backlight_gpio_table, + &da850_lcd_supply_gpio_table, +}; + static int da850_lcd_hw_init(void) { struct platform_device *backlight; int status; - gpiod_add_lookup_table(&da850_lcd_backlight_gpio_table); + gpiod_add_lookup_tables(da850_lcd_gpio_lookups, + ARRAY_SIZE(da850_lcd_gpio_lookups)); + backlight = platform_device_register_full(&da850_lcd_backlight_info); if (IS_ERR(backlight)) return PTR_ERR(backlight); - status = gpio_request(DA850_LCD_PWR_PIN, "lcd pwr"); - if (status < 0) + status = platform_device_register(&da850_lcd_supply_device); + if (status) return status; - gpio_direction_output(DA850_LCD_PWR_PIN, 0); - - /* Switch off panel power */ - da850_panel_power_ctrl(0); - - /* Switch on panel power */ - da850_panel_power_ctrl(1); - return 0; } @@ -1458,7 +1485,6 @@ static __init void da850_evm_init(void) if (ret) pr_warn("%s: LCD initialization failed: %d\n", __func__, ret); - sharp_lk043t1dg01_pdata.panel_power_ctrl = da850_panel_power_ctrl, ret = da8xx_register_lcdc(&sharp_lk043t1dg01_pdata); if (ret) pr_warn("%s: LCDC registration failed: %d\n", __func__, ret); -- 2.21.0