Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3204051pxk; Mon, 21 Sep 2020 07:48:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwW+c2EyIM/h0YT/DTMZX8oVQnr8JELvnDcz/4h1Cf2JFuuQLnE0vCi5Dor4Lp2Q4UqWMf7 X-Received: by 2002:a17:906:b74a:: with SMTP id fx10mr49097550ejb.232.1600699739747; Mon, 21 Sep 2020 07:48:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600699739; cv=none; d=google.com; s=arc-20160816; b=TPZUd3TLPU0rxb2vEpxs6v18gQvnuTHVYe07h8ZEm49oX6wL55YJKLClg/OIBFGsBd zMOW01WdtQPGQCRq4hfpX0UIkKct0D0U1vszVjDE0TRqnilLd1ZZlNx+EkVmSPBNQF+E W7FBDhPJG2hJxInAnCCj34OvHwC5vdx+8+OVrzRpFeaZeN+AqAiCfMJE3Ikf9QbRUv/+ YplBJ+s/rHZEzNv6LVagIY+UUwXKpDB6cbjTTJqy/KOuY/VjtMromyabeMLcq4cF7pzI v4TptZaFE7kmK1YbNJVJ+AXl1rrFdF+htjfXqjmYYekEnZaE+mgg2ww/tPumj4WqsPHM RVSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ET70j9DFoyDuhjPMqYzGwDXaXgE0O0adCFpLNEmWoTc=; b=he5XaYK4qhCdTIjiIjsdgScjmQUylZ6eco66/C/RLltTgQ/W06jU9/SMG7YMXMMSQ+ 9rh4SjxMWNDXqBKFWKI4AXsQ5qFpMTr3OQ5QCK7/OgfBwtdQzsyYJP55nBNLfWatIJX0 vSnopF95/PhiwkJWnW0b9/1WMy0RTfrX+Gw9VWXxJ+BIcjFwZy7nHVlEddeyyWq/l1As E5b4cci1YlDfqzMPzhDkNWoDxqBxxTsrMyXCAQ3LXOU4XDGIlH18ZVO3I4FnLBB0hYvO d4Oq76RZVyFNbghkZ80CSmwwdvBX1gdGj28bmXWbAVvfc1Rk8Wz5YtgXtr1S7WH83b0J DPSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n18si6605961edt.207.2020.09.21.07.48.34; Mon, 21 Sep 2020 07:48:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727560AbgIUOrm (ORCPT + 99 others); Mon, 21 Sep 2020 10:47:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727197AbgIUOrk (ORCPT ); Mon, 21 Sep 2020 10:47:40 -0400 Received: from smtp1.goneo.de (smtp1.goneo.de [IPv6:2001:1640:5::8:30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB185C0613CF for ; Mon, 21 Sep 2020 07:47:39 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.goneo.de (Postfix) with ESMTP id 93E7923F16C; Mon, 21 Sep 2020 16:47:38 +0200 (CEST) X-Virus-Scanned: by goneo X-Spam-Flag: NO X-Spam-Score: -3.012 X-Spam-Level: X-Spam-Status: No, score=-3.012 tagged_above=-999 tests=[ALL_TRUSTED=-1, AWL=-0.112, BAYES_00=-1.9] autolearn=ham Received: from smtp1.goneo.de ([127.0.0.1]) by localhost (smtp1.goneo.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mEHcZfRVPuQ9; Mon, 21 Sep 2020 16:47:37 +0200 (CEST) Received: from lem-wkst-02.lemonage.de. (hq.lemonage.de [87.138.178.34]) by smtp1.goneo.de (Postfix) with ESMTPA id 4331123EFBC; Mon, 21 Sep 2020 16:47:37 +0200 (CEST) From: poeschel@lemonage.de To: Miguel Ojeda Sandonis , Willy Tarreau , Ksenija Stanojevic , linux-kernel@vger.kernel.org (open list) Cc: Lars Poeschel Subject: [PATCH v2 01/32] auxdisplay: Use an enum for charlcd backlight on/off ops Date: Mon, 21 Sep 2020 16:46:13 +0200 Message-Id: <20200921144645.2061313-2-poeschel@lemonage.de> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921144645.2061313-1-poeschel@lemonage.de> References: <20191016082430.5955-1-poeschel@lemonage.de> <20200921144645.2061313-1-poeschel@lemonage.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lars Poeschel We use an enum for calling the functions in charlcd, that turn the backlight on or off. This enum is generic and can be used for other charlcd turn of / turn off operations as well. Signed-off-by: Lars Poeschel --- drivers/auxdisplay/charlcd.c | 2 +- drivers/auxdisplay/charlcd.h | 7 ++++++- drivers/auxdisplay/hd44780.c | 2 +- drivers/auxdisplay/panel.c | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/auxdisplay/charlcd.c b/drivers/auxdisplay/charlcd.c index 5aee0f546351..8aaee0fea9ab 100644 --- a/drivers/auxdisplay/charlcd.c +++ b/drivers/auxdisplay/charlcd.c @@ -101,7 +101,7 @@ static void long_sleep(int ms) } /* turn the backlight on or off */ -static void charlcd_backlight(struct charlcd *lcd, int on) +static void charlcd_backlight(struct charlcd *lcd, enum charlcd_onoff on) { struct charlcd_priv *priv = charlcd_to_priv(lcd); diff --git a/drivers/auxdisplay/charlcd.h b/drivers/auxdisplay/charlcd.h index 00911ad0f3de..c66f038e5d2b 100644 --- a/drivers/auxdisplay/charlcd.h +++ b/drivers/auxdisplay/charlcd.h @@ -9,6 +9,11 @@ #ifndef _CHARLCD_H #define _CHARLCD_H +enum charlcd_onoff { + CHARLCD_OFF = 0, + CHARLCD_ON, +}; + struct charlcd { const struct charlcd_ops *ops; const unsigned char *char_conv; /* Optional */ @@ -30,7 +35,7 @@ struct charlcd_ops { /* Optional */ void (*write_cmd_raw4)(struct charlcd *lcd, int cmd); /* 4-bit only */ void (*clear_fast)(struct charlcd *lcd); - void (*backlight)(struct charlcd *lcd, int on); + void (*backlight)(struct charlcd *lcd, enum charlcd_onoff on); }; struct charlcd *charlcd_alloc(unsigned int drvdata_size); diff --git a/drivers/auxdisplay/hd44780.c b/drivers/auxdisplay/hd44780.c index bcbe13092327..5982158557bb 100644 --- a/drivers/auxdisplay/hd44780.c +++ b/drivers/auxdisplay/hd44780.c @@ -37,7 +37,7 @@ struct hd44780 { struct gpio_desc *pins[PIN_NUM]; }; -static void hd44780_backlight(struct charlcd *lcd, int on) +static void hd44780_backlight(struct charlcd *lcd, enum charlcd_onoff on) { struct hd44780 *hd = lcd->drvdata; diff --git a/drivers/auxdisplay/panel.c b/drivers/auxdisplay/panel.c index 1c82d824ae00..de623ae219f1 100644 --- a/drivers/auxdisplay/panel.c +++ b/drivers/auxdisplay/panel.c @@ -708,7 +708,7 @@ static void lcd_send_serial(int byte) } /* turn the backlight on or off */ -static void lcd_backlight(struct charlcd *charlcd, int on) +static void lcd_backlight(struct charlcd *charlcd, enum charlcd_onoff on) { if (lcd.pins.bl == PIN_NONE) return; -- 2.28.0