Message ID | 20231111104225.136512-5-dario.binacchi@amarulasolutions.com |
---|---|
State | New |
Headers | show
Return-Path: <linux-amarula+bncBCQ4XFG47UFRBI5VXWVAMGQEJCU2Q3A@amarulasolutions.com> X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 75CDE3F057 for <linux-amarula@patchwork.amarulasolutions.com>; Sat, 11 Nov 2023 11:42:43 +0100 (CET) Received: by mail-ed1-f70.google.com with SMTP id 4fb4d7f45d1cf-54356d8ea43sf2046602a12.2 for <linux-amarula@patchwork.amarulasolutions.com>; Sat, 11 Nov 2023 02:42:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699699363; cv=pass; d=google.com; s=arc-20160816; b=Gv6kIHE1vyROXBzuG1MToAdYLZqowtOT2NCM50c2uQTdyKw3UC7NX54NTs1Zq7ap5o gUFyPV/kPWuTKGhCBhS++PVJTV2GoEJnnO9SRTn8MEs8P3XtNmgDFCUmDlAA+SeqPdBR 55WAboRWOm/IK/8nG/wm5eYIxCPcOLpXCv4yjDjf0nozfRkOg9phLYP2CvTwR1ohywqN B3/5C/pHrFNsSc/bSl6GnxNRNNXHT+UFMAArigTa2oFaRDFVq5NDTvUiF26Avlcs0MkX mxIw6O3AZrZZIR7niRU++Ym6i71i3rIJlIvHEpdmwMKiEyykCqi0tCntDeqqD8xwFYsZ e07w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=zUZK735Yr3+TtvwADh4fq0jQSebkuh+l86UMJ1QYIEo=; fh=CRQFspQ+XVmz3jTpDmawxjgq3paXQGVEDP+3Wpr+FXU=; b=qfHE+Y+dMyqOMY8e7iqnWsLlGgUO3bzMxU3Od9TiUMhOounMs81wEKE1WSIN0ghWad tJyLYAZYNqDVdN3eHIxNYtwXUF7DBd7JVCXg4gpsHtIwyWn9fpgDI/3SBARMa7RQ6tIW oBlafGu4RlxUHluqD+eZ/2sYcWGu+9FMmeeDhTNMmGp6FfH8/llHNJZXLt4q0XMwn+JJ F1t2x85uNaUERDskPzxmUSF8p9IC7Ui0jHCYtRONIT/yI/Bm7zUafiyzRdu+tuGIsswR 1FwbnAmBGEWBvCC3HTxY5TUmlXSK9BVlqqHjEzyC6hc7tuotrSrFCpzvUB9XD4HxcdNB E7Jw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Ln6dH3k3; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1699699363; x=1700304163; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=zUZK735Yr3+TtvwADh4fq0jQSebkuh+l86UMJ1QYIEo=; b=aX3/0L2xYL9sHy14DpIS7+xoMw4GrxWNS3hKAnkdAEwrsgf3/pRCeWEEClmaAK12GW aJWxZuUwtX/jkxI++k9i8GA3eFO1FvEMqC7vgbeiilRkha2FHxaIStUYgmaBB0nOxC7O 4Mdz2K3X8SQDNEFJCG56T19sLx7vN8kLh1NTU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699699363; x=1700304163; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-beenthere:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zUZK735Yr3+TtvwADh4fq0jQSebkuh+l86UMJ1QYIEo=; b=a1voj6YsP4xqnTWZOPjFZrS6lODiuXRlOf5OckBR1iRSMgsTGqMVHUPl/bNEWzdDZ9 9k441eaYMvF4RBazq24az0HTx6RiLGmk2l0o35xSsLkm3UpxRWi8Sdqranv7jh0bFiJT jzPm48ZCGsuRD5gkj+H/UG+KD5TflVU/rXWeDHCoUdoMxAh6UwiE0hohuzTnmxjXRVqh zKou7XJlJ0GKvt+qxIWH+0hsMHT1SZtbsLyOR2yHHZXsoYuhDZ/MGElnn8Xx5PBY4cIm O3feMdfMqDMKUGkf1UW9iuV5JWo0Fmvu0/fpSk4j9pGzbSH0NDu+5kopQsQIVaJ8Yv2x KG2Q== X-Gm-Message-State: AOJu0YxUXzthsTDxLRQZjbwp4HV1fVYrUdhhF6F3tiXHa9T62vmze5gc YJNsfxSwXPpZCNfNTIifKxdyD0PN X-Google-Smtp-Source: AGHT+IHOUxD42eHq8IlIOFr/YNZYux47QsvU70Vk4ZWcssEjnBkzzS/PVEbhjbpyNXL9KugmXObQVQ== X-Received: by 2002:aa7:d5cd:0:b0:53b:9948:cc1f with SMTP id d13-20020aa7d5cd000000b0053b9948cc1fmr1312536eds.12.1699699363263; Sat, 11 Nov 2023 02:42:43 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:1645:b0:542:df39:bcf2 with SMTP id s5-20020a056402164500b00542df39bcf2ls762905edx.1.-pod-prod-01-eu; Sat, 11 Nov 2023 02:42:42 -0800 (PST) X-Received: by 2002:a17:906:24d4:b0:9c7:5a14:ecf2 with SMTP id f20-20020a17090624d400b009c75a14ecf2mr1102195ejb.56.1699699361699; Sat, 11 Nov 2023 02:42:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699699361; cv=none; d=google.com; s=arc-20160816; b=SAGh5XJTokiqs6a/pyF6VaPZieZ06Qq8Zbh4j87HBOWVOkcHDxw9dAvS4m7/BHY0wK zOs3Vg4U/olt626Cvpz8dCeLfhib+ws4vkCGZIlinXX/UDYq8RVYzKi1IZVyWknXG1QV 5vfJBP3C+sVVM+36tJNQcvI7lkbWPoQwrD7bF2WmFfCEOeQrq403TE+vLuGs6Pth2h6R c0EHG2iUmpbZyo2g43IqdYqRNr92pP8cZxEWg/znrlxhzsD8irq1KgPAjAdB2BzuWnUR PdqVvFo2MyXvZkoOcZt9xgGBLHwycD+de0HqlXjryTJfWkOmUHcvw1dNGh9i6nD1gLXt cVWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=ZuBW6agG70lIoCkGnVCWEFfcl6uwNB9B1+pa2Yxc8Go=; fh=CRQFspQ+XVmz3jTpDmawxjgq3paXQGVEDP+3Wpr+FXU=; b=ErCQhStD13qn25cm9TB2b9smNOMxhysY1Fr4blmnCTSfLUkoKBPK/MhmHW5y9MNUWD RBAG5DvqCsXrCQHuf1mFCzNANOI3pRyp3FoTBzR8nyeKLPYggK5K44dDDI9J2UjkJzNI j3WUg6A2aPkG7uroshEn7m65vzLy1XmM43lqNdYjmFcyMKmEwucIw96MpCy5Elk13RZM 3vnL1t1iL1LdRwMWAsr/X5xpkUBcQ3M/Y7XXWs6AjgWpRCdUtSIZ/9WZzLPVyFUi203t Q5wQZ97XjGJuXAo15V9edcYoP4q9x9Id+08wo32IHMFDz7Mve8eHWsq55bFpX662EZOz exCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Ln6dH3k3; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id v17-20020a17090651d100b009b2b42978adsor261523ejk.7.2023.11.11.02.42.41 for <linux-amarula@amarulasolutions.com> (Google Transport Security); Sat, 11 Nov 2023 02:42:41 -0800 (PST) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a17:906:3c9:b0:9e6:59d5:7a86 with SMTP id c9-20020a17090603c900b009e659d57a86mr915376eja.57.1699699361285; Sat, 11 Nov 2023 02:42:41 -0800 (PST) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-79-20-97-182.retail.telecomitalia.it. [79.20.97.182]) by smtp.gmail.com with ESMTPSA id ga33-20020a1709070c2100b0099e12a49c8fsm872183ejc.173.2023.11.11.02.42.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Nov 2023 02:42:41 -0800 (PST) From: Dario Binacchi <dario.binacchi@amarulasolutions.com> To: linux-kernel@vger.kernel.org Cc: linux-amarula@amarulasolutions.com, Dario Binacchi <dario.binacchi@amarulasolutions.com>, Fabio Estevam <festevam@gmail.com>, Helge Deller <deller@gmx.de>, NXP Linux Team <linux-imx@nxp.com>, Pengutronix Kernel Team <kernel@pengutronix.de>, Sascha Hauer <s.hauer@pengutronix.de>, Shawn Guo <shawnguo@kernel.org>, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org Subject: [PATCH 04/10] fbdev: imxfb: replace some magic numbers with constants Date: Sat, 11 Nov 2023 11:41:53 +0100 Message-ID: <20231111104225.136512-5-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231111104225.136512-1-dario.binacchi@amarulasolutions.com> References: <20231111104225.136512-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Ln6dH3k3; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: <linux-amarula.amarulasolutions.com> X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/post>, <mailto:linux-amarula@amarulasolutions.com> List-Help: <https://support.google.com/a/amarulasolutions.com/bin/topic.py?topic=25838>, <mailto:linux-amarula+help@amarulasolutions.com> List-Archive: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/> List-Unsubscribe: <mailto:googlegroups-manage+476853432473+unsubscribe@googlegroups.com>, <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/subscribe> |
Series |
|
Related |
show
|
diff --git a/drivers/video/fbdev/imxfb.c b/drivers/video/fbdev/imxfb.c index b7ef43a7930a..485e57fa9389 100644 --- a/drivers/video/fbdev/imxfb.c +++ b/drivers/video/fbdev/imxfb.c @@ -89,6 +89,7 @@ struct imx_fb_videomode { #define PCR_BPIX_12 4 #define PCR_BPIX_16 5 #define PCR_BPIX_18 6 +#define PCR_PCD_MASK GENMASK(5, 0) #define LCDC_HCR 0x1C #define HCR_H_WIDTH_MASK GENMASK(31, 26) @@ -414,8 +415,8 @@ static int imxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) pcr = (unsigned int)tmp; - if (--pcr > 0x3F) { - pcr = 0x3F; + if (--pcr > PCR_PCD_MASK) { + pcr = PCR_PCD_MASK; printk(KERN_WARNING "Must limit pixel clock to %luHz\n", lcd_clk / pcr); } @@ -444,7 +445,7 @@ static int imxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) } /* add sync polarities */ - pcr |= imxfb_mode->pcr & ~(0x3f | (7 << 25)); + pcr |= imxfb_mode->pcr & ~(PCR_PCD_MASK | PCR_BPIX_MASK); fbi->pcr = pcr; /*
The patch gets rid of magic numbers replacing them with appropriate macros. Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> --- drivers/video/fbdev/imxfb.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)