From patchwork Fri Jun 26 20:37:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 191920 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp821562ilg; Fri, 26 Jun 2020 13:37:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytGxQtwoXYDIiC1okHnmhbdGz8fqeniaJOqNeWGwJr+3EoKP5JXyWfR5IMmUgQHsZF+jHT X-Received: by 2002:a62:75c7:: with SMTP id q190mr4463540pfc.289.1593203872085; Fri, 26 Jun 2020 13:37:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593203872; cv=none; d=google.com; s=arc-20160816; b=mTfOEftv0RdY/qcS5lt69h0r9j2wo16/yVUaSCbYLUt3MW1l/2rQHHczmW+WKlWTC7 ZqKRUe+dRlvxXfKB5N2SYOm0enZOxZ/DetsRooQWH3RF5WxAueFLotpQuslP5DcMiG0P 5g781nFbbNVZmmms0vvm0eF0Ig9tKzZ/eOex/WzOZmeezhJDJixrPaes/F1OzVwp6YE3 XS2L1wvqZNP/yGWyC2mFpX6oeDnKHzHHpoT9CLimi1XeTM5bOPDb7m/+eufPUqga6exY 63eAGBe3TIvo3iC+MbliNj50AcuWMk3IJH+4hPH41ds98PvYCbJUr8ebAQKSxMydVXWz iIsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:message-id:date:subject:to:from :dkim-signature:delivered-to; bh=BaiexG66UF7oObbIlG+esTpk1HbYAt+l2c6itvFms8U=; b=KJDFE9menmby44L62j5PnR3YKT/vbMeaCoAjOs2S2Mq5P9jLYlnZz2K3Qg3ZyBhtrs 3WD+BeZfIWUu81jREG4r3zzP9Ye4PVLqS3C0kynPGjr3uHwv3DqFdPJ7JksgIJH+WSx9 QDBTgSQXsLEEap9EL6l5NNo6ljJOcQpKLRQd85dJmLa4vw0fwfE6DKP0qS3Se6zpCukf V2GMhzm8RW6qqQTdzH5t8jgezXJFH5h3Vzrctg63FZ9ebDqiX7ZTpekeH7/EgainCtCJ P5Xk+ushBqIx38hT3qcFret0QLz5HqPthzsafA9ohey701u9fto+xWgTOIIa88UoBoh6 YbcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="JG/g+/r4"; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id z6si18616865plb.373.2020.06.26.13.37.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2020 13:37:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="JG/g+/r4"; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 04ECD6E483; Fri, 26 Jun 2020 20:37:48 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1CBAB6E483 for ; Fri, 26 Jun 2020 20:37:47 +0000 (UTC) Received: by mail-lf1-x143.google.com with SMTP id t9so5846768lfl.5 for ; Fri, 26 Jun 2020 13:37:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8VvWqiFIWtVup4e72jzSlxxn0GFKf5oqDLPiC59QfuE=; b=JG/g+/r4y3iFTx3H+GpkfHiWCPPgdNXjIuEHe+Cgkj7VilW+GYxBJZgSlvP68qpLy6 kRzxZnOTKqIuqiIxPCc34uulkwvPh5Du+BdFQLGpwJoBJwJJQV62P8Y3SDIkDnMqR5A7 kx/AyESPeBU2C5jPQY9Uxwq0ls6FDNNkLLctyO1O8B9Wv/SaAUe/3zcXjd5eYOV+rroV P8hCaqtWgRFR3EwCQDfHVRdfazah+IVGGs8fqXlfUIfFBTpQWSxngn2Y8wL99nXrPumP 6CMeT37hUGo/HoZcOw+ddsX/sCmIcDQbGT++pFIlxFkTs9XngDQmI3I36JK9TeKw+GuQ kvZA== 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:mime-version :content-transfer-encoding; bh=8VvWqiFIWtVup4e72jzSlxxn0GFKf5oqDLPiC59QfuE=; b=mNcZtZw1m6OERjAfPPtZ9udfICcKcBXoKZN060ufdvpbRuci9RVdT9yw78dMVOagao 6NwOXqnzDDiVClMjWTthE8Tal+vlVLKJQIiHNkW4CRoPPDiQzLFpNS81EbI52VokXzVV d41TBEkXJ95PySF++OGK9UltfwtdOXGBT7mokPxNHsNKuVqjG3uyJUO0BhYZZT4Usm4B uU5qtW7P3ZENGLL7aGziN9c5++hjaNEZEYJaqOqzSejo8b/tcrT5PpM+tQdKhIaVkTVd LbjcTMMNJd609K1BxBRvHmOKW8qIPF6Mh2jJ4xSMqhn+ySjvsh654qav4bKEDn6QmjAl 45/A== X-Gm-Message-State: AOAM532osEvjMoE8ft1CrGULMmrVqKVqrBUVJeSE4yE8AOJOarW50oXI 7qX147LhegQSdQUOx6KPf4bMuQ== X-Received: by 2002:ac2:54b9:: with SMTP id w25mr2787980lfk.127.1593203865378; Fri, 26 Jun 2020 13:37:45 -0700 (PDT) Received: from genomnajs.lan (c-d63ee155.152980-0-69706f6e6c79.bbcust.telenor.se. [85.225.62.214]) by smtp.gmail.com with ESMTPSA id a21sm475056ljn.2.2020.06.26.13.37.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2020 13:37:44 -0700 (PDT) From: Linus Walleij To: Lee Jones , Daniel Thompson , Jingoo Han , dri-devel@lists.freedesktop.org Subject: [PATCH 1/2] backlight: sky81452: Convert to GPIO descriptors Date: Fri, 26 Jun 2020 22:37:41 +0200 Message-Id: <20200626203742.336780-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gyungoh Yoo Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The SKY81452 backlight driver just obtains a GPIO (named "gpios" in the device tree) drives it high and leaves it high until the driver is removed. Switch to use GPIO descriptors for this, simple and straight-forward. Cc: Gyungoh Yoo Signed-off-by: Linus Walleij --- drivers/video/backlight/sky81452-backlight.c | 18 ++++-------------- .../linux/platform_data/sky81452-backlight.h | 6 ++++-- 2 files changed, 8 insertions(+), 16 deletions(-) -- 2.25.4 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel Reviewed-by: Daniel Thompson diff --git a/drivers/video/backlight/sky81452-backlight.c b/drivers/video/backlight/sky81452-backlight.c index 2355f00f5773..81d2c8f3ca50 100644 --- a/drivers/video/backlight/sky81452-backlight.c +++ b/drivers/video/backlight/sky81452-backlight.c @@ -8,12 +8,11 @@ #include #include -#include +#include #include #include #include #include -#include #include #include #include @@ -182,7 +181,7 @@ static struct sky81452_bl_platform_data *sky81452_bl_parse_dt( pdata->ignore_pwm = of_property_read_bool(np, "skyworks,ignore-pwm"); pdata->dpwm_mode = of_property_read_bool(np, "skyworks,dpwm-mode"); pdata->phase_shift = of_property_read_bool(np, "skyworks,phase-shift"); - pdata->gpio_enable = of_get_gpio(np, 0); + pdata->gpiod_enable = devm_gpiod_get_optional(dev, NULL, GPIOD_OUT_HIGH); ret = of_property_count_u32_elems(np, "led-sources"); if (ret < 0) { @@ -264,15 +263,6 @@ static int sky81452_bl_probe(struct platform_device *pdev) return PTR_ERR(pdata); } - if (gpio_is_valid(pdata->gpio_enable)) { - ret = devm_gpio_request_one(dev, pdata->gpio_enable, - GPIOF_OUT_INIT_HIGH, "sky81452-en"); - if (ret < 0) { - dev_err(dev, "failed to request GPIO. err=%d\n", ret); - return ret; - } - } - ret = sky81452_bl_init_device(regmap, pdata); if (ret < 0) { dev_err(dev, "failed to initialize. err=%d\n", ret); @@ -312,8 +302,8 @@ static int sky81452_bl_remove(struct platform_device *pdev) bd->props.brightness = 0; backlight_update_status(bd); - if (gpio_is_valid(pdata->gpio_enable)) - gpio_set_value_cansleep(pdata->gpio_enable, 0); + if (pdata->gpiod_enable) + gpiod_set_value_cansleep(pdata->gpiod_enable, 0); return 0; } diff --git a/include/linux/platform_data/sky81452-backlight.h b/include/linux/platform_data/sky81452-backlight.h index 02653d92d84f..d6f46670d923 100644 --- a/include/linux/platform_data/sky81452-backlight.h +++ b/include/linux/platform_data/sky81452-backlight.h @@ -9,11 +9,13 @@ #ifndef _SKY81452_BACKLIGHT_H #define _SKY81452_BACKLIGHT_H +#include + /** * struct sky81452_platform_data * @name: backlight driver name. If it is not defined, default name is lcd-backlight. - * @gpio_enable:GPIO number which control EN pin + * @gpios_enable:GPIO descriptor which control EN pin * @enable: Enable mask for current sink channel 1, 2, 3, 4, 5 and 6. * @ignore_pwm: true if DPWMI should be ignored. * @dpwm_mode: true is DPWM dimming mode, otherwise Analog dimming mode. @@ -23,7 +25,7 @@ */ struct sky81452_bl_platform_data { const char *name; - int gpio_enable; + struct gpio_desc *gpiod_enable; unsigned int enable; bool ignore_pwm; bool dpwm_mode; From patchwork Fri Jun 26 20:37:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 191921 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp821584ilg; Fri, 26 Jun 2020 13:37:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw795jBRHcha7qg8B2ldLzP4mzRL/MA9U6q3rlgekelSrI1kTfEZQC8Swdv1pBJX70N1ZsQ X-Received: by 2002:a62:1b82:: with SMTP id b124mr4343470pfb.172.1593203874788; Fri, 26 Jun 2020 13:37:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593203874; cv=none; d=google.com; s=arc-20160816; b=sj4T7MIjvvKgTuXWqUUECRrrYaUcKDYXd/1UKwweyi9ng4jCVyAj/2dbG6nJyD3fh2 C/8aQuGm3VQj8D2tA4OBKfjJkfgNvvaG5tEdleLbgYtGHsF7QABAvtWuxhOZMzHPLT9N wA4JV4V2D//P+awT/b96ho0W+JAfySe+39ngKuW11zTSkoS0AsRaDzm1J4FlEM9VBDfU 3HVc9mK1EWJ4lArXBdKwnxlYMdPKiww2jbrTDZ2lpWLz/R3jPkXt9hgKy38+eUnpVcl5 U458RgU/fleA+593qbeuMjFjsZqzKUORTPgFGnASWPtZbxmnz2IPDZ7bnxXT+E8VgPsH EYfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:delivered-to; bh=90OwPcwZcB/Y/pxAUEnvqBI4y7WvsI+7NHqMUimA6jk=; b=O185xVaqP+MOkUH7DPUOjFOh67aGT/sRYSSoSIwnNDHov+cOWCjZFepOkXXVnoCyx8 k57wCyS3G1UiiGKO/Wq8pLVtoeipDC+Udt0GrJ7QK5JoafzzC/Db0KwMwH2HOcXyXaEs +1U2MyVA4qctffk4M3wvnoEzidphPKGXN8BcA8179AAUDNj4tGfJck/rxk5SQzAt/JKn GqSH2hvwWqwEypNJNahVh+/v0aCqRxJkP81omBw72nEi/OCixo6ejwctAHnFiGusG5jM bSHPNWBmSWoPZsyVn4NSMIKcPGsPTBzRS4icfEhpl2Gz5L4GsLfAuZRFFSkEsp90ew7i KPNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=SmowkzZk; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id k4si18914222pld.41.2020.06.26.13.37.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2020 13:37:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=SmowkzZk; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 52CAF6E49D; Fri, 26 Jun 2020 20:37:50 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf1-x141.google.com (mail-lf1-x141.google.com [IPv6:2a00:1450:4864:20::141]) by gabe.freedesktop.org (Postfix) with ESMTPS id 453636E49D for ; Fri, 26 Jun 2020 20:37:49 +0000 (UTC) Received: by mail-lf1-x141.google.com with SMTP id t9so5846814lfl.5 for ; Fri, 26 Jun 2020 13:37:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QW94rD0l59fFYc+4Q3d54IcHrSYKu6sVXjIJXkSz8L4=; b=SmowkzZkM1wMmQFn+CqkWQ0t2/lGsP231rkn9kW2SUdZB0ne3vg0K3LfKW+UCpVd3v HqC18HNRwNBGvSzTifmmHdjfCOxOXYxjo5O1JoIkk1h6D6cfVWc5Ebe5UespoYaJOKGS jbj3ugy5kzh5XuU/xYcg6mASEkGY/Kn2fiB4rCkP8EbWi+n1ySMeRZITcc1FqPO7K2No 8QGxN4F3prozD0NZ02ISisUSPXLmmKweDZPjXugw9A+VdA8Dgb0Mt4aachvhBkl6c+8U eGAeK9pCQIwceitfk9iGnOrCbJgCUk9GnDJ/DLno13JYQI/0RKtzl5PSN0lkUZEQGIqB fW2A== 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=QW94rD0l59fFYc+4Q3d54IcHrSYKu6sVXjIJXkSz8L4=; b=sydlGSxN/JWsbmoIxXD9dsyytfV7Xe6ooF3/s+vjkpwyKw7zfqv4kWRcRB3EozZ4wv YJsJRrqU6grFwyOoRiVOkBtK7uDpazCDJZMOTd2BYlwhwwqCkohS6GoVj3ZWNImYJffh mgW9ufdbM/K300xfgd3+fGSnKBiIwiT4QrdY14Uk32vOR4ZOZwFnd7RBI7kGYTWhNStA M2iV+VIX0VtdMPbCSJRmbwmJdsHADYq0d0bYFOibtDN+kNH2fQme7F2YbQFWwbn9yMV2 KQbXD6L1foMWxiwtpzz02mRTuodXbWm0kDBDXmxUNDKge0TwTtNgr8SfLpRx8Ol2CjVv WE7Q== X-Gm-Message-State: AOAM531Olc/1pRqMJcN0x+6GPkxisEX/e1MctFetgG6uNmKdUPqMdV1/ m+gdXQ+uwL1XwE31pUrrksNBaA== X-Received: by 2002:ac2:52ac:: with SMTP id r12mr2779255lfm.175.1593203867515; Fri, 26 Jun 2020 13:37:47 -0700 (PDT) Received: from genomnajs.lan (c-d63ee155.152980-0-69706f6e6c79.bbcust.telenor.se. [85.225.62.214]) by smtp.gmail.com with ESMTPSA id a21sm475056ljn.2.2020.06.26.13.37.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2020 13:37:47 -0700 (PDT) From: Linus Walleij To: Lee Jones , Daniel Thompson , Jingoo Han , dri-devel@lists.freedesktop.org Subject: [PATCH 2/2] backlight: sky81452: Privatize platform data Date: Fri, 26 Jun 2020 22:37:42 +0200 Message-Id: <20200626203742.336780-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200626203742.336780-1-linus.walleij@linaro.org> References: <20200626203742.336780-1-linus.walleij@linaro.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gyungoh Yoo Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The only way the platform data for the SKY81452 ever gets populated is through the device tree. The MFD device is bothered with this for no reason at all. Just allocate the platform data in the driver and be happy. Cc: Gyungoh Yoo Signed-off-by: Linus Walleij --- drivers/mfd/sky81452.c | 2 - drivers/video/backlight/sky81452-backlight.c | 34 +++++++++++++---- include/linux/mfd/sky81452.h | 2 - .../linux/platform_data/sky81452-backlight.h | 37 ------------------- 4 files changed, 27 insertions(+), 48 deletions(-) delete mode 100644 include/linux/platform_data/sky81452-backlight.h -- 2.25.4 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel Reviewed-by: Daniel Thompson diff --git a/drivers/mfd/sky81452.c b/drivers/mfd/sky81452.c index 76eedfae8553..3ad35bf0c015 100644 --- a/drivers/mfd/sky81452.c +++ b/drivers/mfd/sky81452.c @@ -47,8 +47,6 @@ static int sky81452_probe(struct i2c_client *client, memset(cells, 0, sizeof(cells)); cells[0].name = "sky81452-backlight"; cells[0].of_compatible = "skyworks,sky81452-backlight"; - cells[0].platform_data = pdata->bl_pdata; - cells[0].pdata_size = sizeof(*pdata->bl_pdata); cells[1].name = "sky81452-regulator"; cells[1].platform_data = pdata->regulator_init_data; cells[1].pdata_size = sizeof(*pdata->regulator_init_data); diff --git a/drivers/video/backlight/sky81452-backlight.c b/drivers/video/backlight/sky81452-backlight.c index 81d2c8f3ca50..83ccb3d940fa 100644 --- a/drivers/video/backlight/sky81452-backlight.c +++ b/drivers/video/backlight/sky81452-backlight.c @@ -15,7 +15,6 @@ #include #include #include -#include #include /* registers */ @@ -41,6 +40,29 @@ #define SKY81452_DEFAULT_NAME "lcd-backlight" #define SKY81452_MAX_BRIGHTNESS (SKY81452_CS + 1) +/** + * struct sky81452_platform_data + * @name: backlight driver name. + If it is not defined, default name is lcd-backlight. + * @gpios_enable:GPIO descriptor which control EN pin + * @enable: Enable mask for current sink channel 1, 2, 3, 4, 5 and 6. + * @ignore_pwm: true if DPWMI should be ignored. + * @dpwm_mode: true is DPWM dimming mode, otherwise Analog dimming mode. + * @phase_shift:true is phase shift mode. + * @short_detecion_threshold: It should be one of 4, 5, 6 and 7V. + * @boost_current_limit: It should be one of 2300, 2750mA. + */ +struct sky81452_bl_platform_data { + const char *name; + struct gpio_desc *gpiod_enable; + unsigned int enable; + bool ignore_pwm; + bool dpwm_mode; + bool phase_shift; + unsigned int short_detection_threshold; + unsigned int boost_current_limit; +}; + #define CTZ(b) __builtin_ctz(b) static int sky81452_bl_update_status(struct backlight_device *bd) @@ -251,17 +273,15 @@ static int sky81452_bl_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct regmap *regmap = dev_get_drvdata(dev->parent); - struct sky81452_bl_platform_data *pdata = dev_get_platdata(dev); + struct sky81452_bl_platform_data *pdata; struct backlight_device *bd; struct backlight_properties props; const char *name; int ret; - if (!pdata) { - pdata = sky81452_bl_parse_dt(dev); - if (IS_ERR(pdata)) - return PTR_ERR(pdata); - } + pdata = sky81452_bl_parse_dt(dev); + if (IS_ERR(pdata)) + return PTR_ERR(pdata); ret = sky81452_bl_init_device(regmap, pdata); if (ret < 0) { diff --git a/include/linux/mfd/sky81452.h b/include/linux/mfd/sky81452.h index d469aa481243..b08570ff34df 100644 --- a/include/linux/mfd/sky81452.h +++ b/include/linux/mfd/sky81452.h @@ -9,11 +9,9 @@ #ifndef _SKY81452_H #define _SKY81452_H -#include #include struct sky81452_platform_data { - struct sky81452_bl_platform_data *bl_pdata; struct regulator_init_data *regulator_init_data; }; diff --git a/include/linux/platform_data/sky81452-backlight.h b/include/linux/platform_data/sky81452-backlight.h deleted file mode 100644 index d6f46670d923..000000000000 --- a/include/linux/platform_data/sky81452-backlight.h +++ /dev/null @@ -1,37 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* - * sky81452.h SKY81452 backlight driver - * - * Copyright 2014 Skyworks Solutions Inc. - * Author : Gyungoh Yoo - */ - -#ifndef _SKY81452_BACKLIGHT_H -#define _SKY81452_BACKLIGHT_H - -#include - -/** - * struct sky81452_platform_data - * @name: backlight driver name. - If it is not defined, default name is lcd-backlight. - * @gpios_enable:GPIO descriptor which control EN pin - * @enable: Enable mask for current sink channel 1, 2, 3, 4, 5 and 6. - * @ignore_pwm: true if DPWMI should be ignored. - * @dpwm_mode: true is DPWM dimming mode, otherwise Analog dimming mode. - * @phase_shift:true is phase shift mode. - * @short_detecion_threshold: It should be one of 4, 5, 6 and 7V. - * @boost_current_limit: It should be one of 2300, 2750mA. - */ -struct sky81452_bl_platform_data { - const char *name; - struct gpio_desc *gpiod_enable; - unsigned int enable; - bool ignore_pwm; - bool dpwm_mode; - bool phase_shift; - unsigned int short_detection_threshold; - unsigned int boost_current_limit; -}; - -#endif