From patchwork Thu Jan 16 14:08:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 11337121 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A566192A for ; Thu, 16 Jan 2020 14:09:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 83A0B2081E for ; Thu, 16 Jan 2020 14:09:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="Z731CrGP" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728939AbgAPOJi (ORCPT ); Thu, 16 Jan 2020 09:09:38 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:46517 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726189AbgAPOJR (ORCPT ); Thu, 16 Jan 2020 09:09:17 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200116140915euoutp027fe49323f1fbc52ed20d411788f13854~qY0JG5Ei20809608096euoutp02D for ; Thu, 16 Jan 2020 14:09:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200116140915euoutp027fe49323f1fbc52ed20d411788f13854~qY0JG5Ei20809608096euoutp02D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1579183755; bh=1y4h/ckmlOOn04vcRlmb2VBW9p/7FoCZ6c8TpaKL8tg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z731CrGPShUqh9yDDlngj5FvZWyMn3L9zpMcRWVWNFB6CtzcVmdGf9vZUGOaEgW+N 6UFO1bqwRkX23WmSFbfuwEQ2u3cbrhSLIUHR5qFkQk7uYW9AIub4nd3/AWAFQCEo4d Vs1IqkysSCHwdDAIgga5YvtBG1KANxUVqrvNhDUU= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200116140915eucas1p17f3346592c483649c006baef8015e1b8~qY0I6NrO20528405284eucas1p1s; Thu, 16 Jan 2020 14:09:15 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id A8.7E.61286.B8E602E5; Thu, 16 Jan 2020 14:09:15 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200116140915eucas1p2d6a2c654a66a78b6c3c1fc710f8a65b8~qY0Irp7it2447024470eucas1p2_; Thu, 16 Jan 2020 14:09:15 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200116140915eusmtrp2e91f74de4673ee1a69a0c3648d3b53d1~qY0InRigJ0965509655eusmtrp2A; Thu, 16 Jan 2020 14:09:15 +0000 (GMT) X-AuditID: cbfec7f2-ef1ff7000001ef66-46-5e206e8b10f7 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id E9.80.07950.B8E602E5; Thu, 16 Jan 2020 14:09:15 +0000 (GMT) Received: from AMDC3058.digital.local (unknown [106.120.51.71]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200116140914eusmtip10bfaf836e2919005c52838620cab6bc2~qY0ITO-Ea0711307113eusmtip1A; Thu, 16 Jan 2020 14:09:14 +0000 (GMT) From: Bartlomiej Zolnierkiewicz To: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Andrzej Hajda , b.zolnierkie@samsung.com Subject: [PATCH 1/6] video: fbdev: controlfb: fix sparse warning about using incorrect type Date: Thu, 16 Jan 2020 15:08:55 +0100 Message-Id: <20200116140900.26363-2-b.zolnierkie@samsung.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200116140900.26363-1-b.zolnierkie@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupkleLIzCtJLcpLzFFi42LZduzned3uPIU4g8PzJS1urTvHarFxxnpW iytf37NZnOj7wGpxedccNgdWj/vdx5k8+rasYvT4vEkugDmKyyYlNSezLLVI3y6BK+P7im6m gj6uiiM3rjI3MB7l6GLk5JAQMJF41LyHqYuRi0NIYAWjxNeOLlaQhJDAF0aJdx8qIBKfGSXa Nv5ihun4u2MtC0RiOaPE2Y6pbBAOUMe2jXvZQKrYBKwkJravYgSxRQQSJFZMnwFkc3AwCzhK NPfzgZjCArESHUcVQCpYBFQlvu/tZgKxeQVsJZ5ObmWD2CUvsfXbJ7CDOAXsJOaduscIUSMo cXLmExYQmxmopnnrbGaQEyQEPrNJPGhcwQjR7CKxbdFEVghbWOLV8S3sELaMxP+d85kgGtYx SvzteAHVvZ1RYvnkf1CrrSXunPvFBnG0psT6XfoQYUeJeW/+sYKEJQT4JG68FYQ4gk9i0rbp zBBhXomONiGIajWJDcs2sMGs7dq5EhqGHhKf2tYxT2BUnIXknVlI3pmFsHcBI/MqRvHU0uLc 9NRiw7zUcr3ixNzi0rx0veT83E2MwARy+t/xTzsYv15KOsQowMGoxMM7I0ghTog1say4MvcQ owQHs5II78kZsnFCvCmJlVWpRfnxRaU5qcWHGKU5WJTEeY0XvYwVEkhPLEnNTk0tSC2CyTJx cEo1MOr0LL3GGOHY3Zr5pmteuGH7heXe+WdqCjecPvYgIKKjktFosohy6hzrcB4x6f2pvOej J9+WlnvCyz27qt1s3g0nI7Ge36Xml5y26eh3FOtE3anfVHIrUlWUXVWz7uKCfa/Zimx9/yuI iC3I03WwXNsukXpx9ZGDydLvazdNj95WkcYpW6ajxFKckWioxVxUnAgATmGlDBwDAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrGLMWRmVeSWpSXmKPExsVy+t/xu7rdeQpxBs2NLBa31p1jtdg4Yz2r xZWv79ksTvR9YLW4vGsOmwOrx/3u40wefVtWMXp83iQXwBylZ1OUX1qSqpCRX1xiqxRtaGGk Z2hpoWdkYqlnaGwea2VkqqRvZ5OSmpNZllqkb5egl/F9RTdTQR9XxZEbV5kbGI9ydDFyckgI mEj83bGWpYuRi0NIYCmjxLVJ/4AcDqCEjMTx9WUQNcISf651sYHYQgKfGCV+L1IAsdkErCQm tq9iBLFFBJIkOhtOMoPYzALOErNuPWICsYUFoiW+bJjMDmKzCKhKfN/bDRbnFbCVeDq5lQ1i vrzE1m+fWEFsTgE7iXmn7jGCnCAEVHNomhREuaDEyZlPWCDGy0s0b53NPIFRYBaS1CwkqQWM TKsYRVJLi3PTc4uN9IoTc4tL89L1kvNzNzECw3zbsZ9bdjB2vQs+xCjAwajEwzsjSCFOiDWx rLgy9xCjBAezkgjvyRmycUK8KYmVValF+fFFpTmpxYcYTYF+mMgsJZqcD4zBvJJ4Q1NDcwtL Q3Njc2MzCyVx3g6BgzFCAumJJanZqakFqUUwfUwcnFINjL5m3UKF1/e/VDp3x0HqYvWx2bf9 HaVT/L6em+U8TfNrfKDY3FCWx2bOTx+57FBhz3tc7no75n3AxoMLNp5ruu97LCpUf/Zx5rLT +6NlFLkfZZY0v2aVU+ue37WU79uVq1FVSXP+n37DeYjf48M2eZYLIXY2oismXVXZHFa8YuVD 7q0NHNbK1UosxRmJhlrMRcWJAOEsIpGJAgAA X-CMS-MailID: 20200116140915eucas1p2d6a2c654a66a78b6c3c1fc710f8a65b8 X-Msg-Generator: CA X-RootMTR: 20200116140915eucas1p2d6a2c654a66a78b6c3c1fc710f8a65b8 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200116140915eucas1p2d6a2c654a66a78b6c3c1fc710f8a65b8 References: <20200116140900.26363-1-b.zolnierkie@samsung.com> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org Force le32_to_cpup() argument to be of proper type (const __le32 *). Also add missing inline keyword to control_par_to_var() definition (to match function prototype). Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/video/fbdev/controlfb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/video/fbdev/controlfb.c b/drivers/video/fbdev/controlfb.c index 38b61cdb5ca4..d7e53520a24c 100644 --- a/drivers/video/fbdev/controlfb.c +++ b/drivers/video/fbdev/controlfb.c @@ -313,7 +313,7 @@ static int controlfb_blank(int blank_mode, struct fb_info *info) container_of(info, struct fb_info_control, info); unsigned ctrl; - ctrl = le32_to_cpup(CNTRL_REG(p,ctrl)); + ctrl = le32_to_cpup((const __force __le32 *)CNTRL_REG(p, ctrl)); if (blank_mode > 0) switch (blank_mode) { case FB_BLANK_VSYNC_SUSPEND: @@ -952,7 +952,8 @@ static int control_var_to_par(struct fb_var_screeninfo *var, * Convert hardware data in par to an fb_var_screeninfo */ -static void control_par_to_var(struct fb_par_control *par, struct fb_var_screeninfo *var) +static inline void control_par_to_var(struct fb_par_control *par, + struct fb_var_screeninfo *var) { struct control_regints *rv; From patchwork Thu Jan 16 14:08:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 11337097 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 91A8F92A for ; Thu, 16 Jan 2020 14:09:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5CC372077C for ; Thu, 16 Jan 2020 14:09:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="eW0VN+C1" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726871AbgAPOJR (ORCPT ); Thu, 16 Jan 2020 09:09:17 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:50629 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726566AbgAPOJR (ORCPT ); Thu, 16 Jan 2020 09:09:17 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200116140915euoutp01796d4e25de40281338cbbb6fb7e76a0a~qY0JWkLB50568405684euoutp01D for ; Thu, 16 Jan 2020 14:09:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200116140915euoutp01796d4e25de40281338cbbb6fb7e76a0a~qY0JWkLB50568405684euoutp01D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1579183755; bh=hxK11kkBXgZVMjcY/jODBwxg2OYmZ/75Eq6amFqRm4Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eW0VN+C1yNOO6GJEn0/vu0BcxOKdT7dtSEzJ+OrAhebt+AfCWlv3usqMiIVgAtctO GQnSvnigTjoa3SPVgbyYznwoOq+r7tyRfkHK2xYHRDrWYgByooX+EuHZ/Xs2jbn1NG 7e7RC+y4moL5jF1wxnBc+gNUSL13efEFJ19voGAc= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200116140915eucas1p15a447ecd8f844fb1d40dbb25e8fa8040~qY0JJWPyO0480504805eucas1p13; Thu, 16 Jan 2020 14:09:15 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 9C.FD.60679.B8E602E5; Thu, 16 Jan 2020 14:09:15 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200116140915eucas1p1d3696cbe492d55a4e4946c7e2d13f9d2~qY0I5x6_20480904809eucas1p1n; Thu, 16 Jan 2020 14:09:15 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200116140915eusmtrp2e809632a577c2e4646290929e975520b~qY0I5Of9E0965509655eusmtrp2C; Thu, 16 Jan 2020 14:09:15 +0000 (GMT) X-AuditID: cbfec7f4-0cbff7000001ed07-4d-5e206e8b9b8c Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 3B.80.07950.B8E602E5; Thu, 16 Jan 2020 14:09:15 +0000 (GMT) Received: from AMDC3058.digital.local (unknown [106.120.51.71]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200116140915eusmtip1c758cc05f169c2eef57dd474eb558d23~qY0Il6wSt0665506655eusmtip1V; Thu, 16 Jan 2020 14:09:15 +0000 (GMT) From: Bartlomiej Zolnierkiewicz To: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Andrzej Hajda , b.zolnierkie@samsung.com Subject: [PATCH 2/6] video: fbdev: controlfb: remove obsolete module support Date: Thu, 16 Jan 2020 15:08:56 +0100 Message-Id: <20200116140900.26363-3-b.zolnierkie@samsung.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200116140900.26363-1-b.zolnierkie@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupgleLIzCtJLcpLzFFi42LZduznOd3uPIU4g91LNCxurTvHarFxxnpW iytf37NZnOj7wGpxedccNgdWj/vdx5k8+rasYvT4vEkugDmKyyYlNSezLLVI3y6BK2Niv0LB G+6KmQe3sDcw3uLsYuTkkBAwkbg54SVLFyMXh5DACkaJWw+vsYEkh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hQV8JN4uOQ5WwyKgKjF9+RNWEJtXwFZiS/sjVogF 8hJbv30CszkF7CTmnbrHCHKDEFDNoWlSEOWCEidnPmGBGC8v0bx1NvMERoFZSFKzkKQWMDKt YhRJLS3OTc8tNtIrTswtLs1L10vOz93ECAzzbcd+btnB2PUu+BCjAAejEg/vjCCFOCHWxLLi ytxDjBIczEoivCdnyMYJ8aYkVlalFuXHF5XmpBYfYjQF+mEis5Rocj4wBvNK4g1NDc0tLA3N jc2NzSyUxHk7BA7GCAmkJ5akZqemFqQWwfQxcXBKNTCerF4x66L+ObZ7e1uUX0jOf9gRk/uL qzc19OyOjtain4/+LqmS+nk92uvBK7eESeqr8yZZFk1JOLR0c7eO3GqThIZ0Cbu0e86sqcaf d8yofXpR1jHm0cyHUo4aM57HO2lO37NmdfjToucvH/c9n9jlytlsL/n+1AeLI9H3vmqafPip PnV+u8E3JZbijERDLeai4kQAv0PkF4kCAAA= X-CMS-MailID: 20200116140915eucas1p1d3696cbe492d55a4e4946c7e2d13f9d2 X-Msg-Generator: CA X-RootMTR: 20200116140915eucas1p1d3696cbe492d55a4e4946c7e2d13f9d2 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200116140915eucas1p1d3696cbe492d55a4e4946c7e2d13f9d2 References: <20200116140900.26363-1-b.zolnierkie@samsung.com> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org CONFIG_FB_CONTROL is bool, hence the Apple "control" frame buffer driver cannot be built as a module. Replace module_init() by device_initcall(). Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/video/fbdev/controlfb.c | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/drivers/video/fbdev/controlfb.c b/drivers/video/fbdev/controlfb.c index d7e53520a24c..bd0f61d8bdb5 100644 --- a/drivers/video/fbdev/controlfb.c +++ b/drivers/video/fbdev/controlfb.c @@ -31,7 +31,6 @@ * more details. */ -#include #include #include #include @@ -173,28 +172,6 @@ static const struct fb_ops controlfb_ops = { /******************** The functions for controlfb_ops ********************/ -#ifdef MODULE -MODULE_LICENSE("GPL"); - -int init_module(void) -{ - struct device_node *dp; - int ret = -ENXIO; - - dp = of_find_node_by_name(NULL, "control"); - if (dp && !control_of_init(dp)) - ret = 0; - of_node_put(dp); - - return ret; -} - -void cleanup_module(void) -{ - control_cleanup(); -} -#endif - /* * Checks a var structure */ @@ -587,7 +564,7 @@ static int __init control_init(void) return ret; } -module_init(control_init); +device_initcall(control_init); /* Work out which banks of VRAM we have installed. */ /* danj: I guess the card just ignores writes to nonexistant VRAM... */ From patchwork Thu Jan 16 14:08:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 11337099 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BC90A1820 for ; Thu, 16 Jan 2020 14:09:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9B1E62077C for ; Thu, 16 Jan 2020 14:09:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="ozuh75am" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726887AbgAPOJR (ORCPT ); Thu, 16 Jan 2020 09:09:17 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:46529 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726853AbgAPOJR (ORCPT ); Thu, 16 Jan 2020 09:09:17 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200116140916euoutp02d1dfb727daaf92fde6027b374ce34ba8~qY0J03VU00752307523euoutp02k for ; Thu, 16 Jan 2020 14:09:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200116140916euoutp02d1dfb727daaf92fde6027b374ce34ba8~qY0J03VU00752307523euoutp02k DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1579183756; bh=4b2kZUKHe8BuGKdW66ZpFS0aOp/lsq8V4/w6GQZoDUI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ozuh75amOHq+7DV7yjjlNs9Ppxtd7xZ0khYszzGWSzpsQxmBXALxForsusLYvug/l sLRJh3C6hCTgH1v7whQdNrse7d+M18sgWO5b1kTAcjJJWmIIQ5y5oFcfCYTwLVBWDB vAzxxtz1QkT6/B2yTZjFEGRWc/8Hw2gAQW1YkM0o= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200116140916eucas1p25c18a000ec4bd2ae35ff10a921d7ea07~qY0Jj7POK2050420504eucas1p22; Thu, 16 Jan 2020 14:09:16 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 59.7E.61286.B8E602E5; Thu, 16 Jan 2020 14:09:16 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200116140915eucas1p28dfeecf8a58cecb00262fe86fd19c4f5~qY0JLv4pR1918219182eucas1p2D; Thu, 16 Jan 2020 14:09:15 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200116140915eusmtrp298440ba1eb9261f67ab2e9dcccf6a23f~qY0JLJBkq0965509655eusmtrp2D; Thu, 16 Jan 2020 14:09:15 +0000 (GMT) X-AuditID: cbfec7f2-ef1ff7000001ef66-48-5e206e8b10ba Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 9B.80.07950.B8E602E5; Thu, 16 Jan 2020 14:09:15 +0000 (GMT) Received: from AMDC3058.digital.local (unknown [106.120.51.71]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200116140915eusmtip1bdab67b4f477ab38cbd85f70b6e268bd~qY0I35ezq0711307113eusmtip1B; Thu, 16 Jan 2020 14:09:15 +0000 (GMT) From: Bartlomiej Zolnierkiewicz To: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Andrzej Hajda , b.zolnierkie@samsung.com Subject: [PATCH 3/6] video: fbdev: controlfb: add COMPILE_TEST support Date: Thu, 16 Jan 2020 15:08:57 +0100 Message-Id: <20200116140900.26363-4-b.zolnierkie@samsung.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200116140900.26363-1-b.zolnierkie@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupgleLIzCtJLcpLzFFi42LZduznOd2ePIU4g+5OJotb686xWmycsZ7V 4srX92wWJ/o+sFpc3jWHzYHV4373cSaPvi2rGD0+b5ILYI7isklJzcksSy3St0vgyri04B1L wWSxit8zdzA3MM4V6mLk5JAQMJH4cbCfEcQWEljBKNHxjRvC/sIoca1LtIuRC8j+zChxb8F9 ZpiGtStbmCASyxklrs5cxgrhAHXM+fEebBSbgJXExPZVYLaIQILEiukzgGwODmYBR4nmfj6Q sLCAm8SjfXfASlgEVCW+310CZvMK2EpsmvQKapm8xNZvn1hBbE4BO4l5p+5B1QhKnJz5hAXE Zgaqad46mxnkBgmB72wSLy7OZoNodpH4OPkYlC0s8er4FnYIW0bi/875TBAN6xgl/na8gOre ziixfPI/qA5riTvnfrFBXK0psX6XPogpAfTAvVnGECafxI23ghA38ElM2jadGSLMK9HRBg1c NYkNyzawwWzt2rkS6i0PibZDzUwTGBVnIflmFpJvZiGsXcDIvIpRPLW0ODc9td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FnAktxlt3up1L0Xps4f8p W6R7Jn8e21lWnTObNlr+uHXv2r+dEcVJJyJTDebOmKv+8/9WgfMfnzdM1/F6fSsyM2L5/GDb tZ1LOu7mXFJiKc5INNRiLipOBACxUS5nigIAAA== X-CMS-MailID: 20200116140915eucas1p28dfeecf8a58cecb00262fe86fd19c4f5 X-Msg-Generator: CA X-RootMTR: 20200116140915eucas1p28dfeecf8a58cecb00262fe86fd19c4f5 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200116140915eucas1p28dfeecf8a58cecb00262fe86fd19c4f5 References: <20200116140900.26363-1-b.zolnierkie@samsung.com> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org Add COMPILE_TEST support to controlfb driver for better compile testing coverage. Signed-off-by: Bartlomiej Zolnierkiewicz Acked-by: Sam Ravnborg --- drivers/video/fbdev/Kconfig | 2 +- drivers/video/fbdev/controlfb.c | 21 +++++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig index aa9541bf964b..91c872457863 100644 --- a/drivers/video/fbdev/Kconfig +++ b/drivers/video/fbdev/Kconfig @@ -472,7 +472,7 @@ config FB_OF config FB_CONTROL bool "Apple \"control\" display support" - depends on (FB = y) && PPC_PMAC && PPC32 + depends on (FB = y) && ((PPC_PMAC && PPC32) || COMPILE_TEST) select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT diff --git a/drivers/video/fbdev/controlfb.c b/drivers/video/fbdev/controlfb.c index bd0f61d8bdb5..87cd817ad4c6 100644 --- a/drivers/video/fbdev/controlfb.c +++ b/drivers/video/fbdev/controlfb.c @@ -47,12 +47,25 @@ #include #include #include +#ifdef CONFIG_PPC_PMAC #include #include +#endif #include "macmodes.h" #include "controlfb.h" +#ifndef CONFIG_PPC_PMAC +#undef in_8 +#undef out_8 +#undef in_le32 +#undef out_le32 +#define in_8(addr) 0 +#define out_8(addr, val) +#define in_le32(addr) 0 +#define out_le32(addr, val) +#endif + struct fb_par_control { int vmode, cmode; int xres, yres; @@ -278,7 +291,9 @@ static int controlfb_mmap(struct fb_info *info, vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); } else { /* framebuffer */ +#ifdef CONFIG_PPC_PMAC vma->vm_page_prot = pgprot_cached_wthru(vma->vm_page_prot); +#endif } return vm_iomap_memory(vma, start, len); @@ -582,13 +597,14 @@ static void __init find_vram_size(struct fb_info_control *p) out_8(&p->frame_buffer[0x600000], 0xb3); out_8(&p->frame_buffer[0x600001], 0x71); +#ifdef CONFIG_PPC_PMAC asm volatile("eieio; dcbf 0,%0" : : "r" (&p->frame_buffer[0x600000]) : "memory" ); mb(); asm volatile("eieio; dcbi 0,%0" : : "r" (&p->frame_buffer[0x600000]) : "memory" ); mb(); - +#endif bank2 = (in_8(&p->frame_buffer[0x600000]) == 0xb3) && (in_8(&p->frame_buffer[0x600001]) == 0x71); @@ -601,13 +617,14 @@ static void __init find_vram_size(struct fb_info_control *p) out_8(&p->frame_buffer[0], 0x5a); out_8(&p->frame_buffer[1], 0xc7); +#ifdef CONFIG_PPC_PMAC asm volatile("eieio; dcbf 0,%0" : : "r" (&p->frame_buffer[0]) : "memory" ); mb(); asm volatile("eieio; dcbi 0,%0" : : "r" (&p->frame_buffer[0]) : "memory" ); mb(); - +#endif bank1 = (in_8(&p->frame_buffer[0]) == 0x5a) && (in_8(&p->frame_buffer[1]) == 0xc7); From patchwork Thu Jan 16 14:08:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 11337101 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CF21192A for ; Thu, 16 Jan 2020 14:09:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A3C0A2077C for ; Thu, 16 Jan 2020 14:09:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="L4KNPdpP" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726936AbgAPOJT (ORCPT ); Thu, 16 Jan 2020 09:09:19 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:46544 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726928AbgAPOJS (ORCPT ); Thu, 16 Jan 2020 09:09:18 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200116140916euoutp02adef9b7f479dd56a0b431aca4696176d~qY0J-Teg30770007700euoutp02Y for ; Thu, 16 Jan 2020 14:09:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200116140916euoutp02adef9b7f479dd56a0b431aca4696176d~qY0J-Teg30770007700euoutp02Y DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1579183756; bh=BGAg8y4UkwrAPBhyuTyPVRdvR/Vd6CHyN7f6GtWcWZQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L4KNPdpPJ4GAJs6opH4MsqSXjZq/h/kVdC4uTbbpi5HGdVpKE+HFZ42elj6V5qPmw rrZUCE34Vm6ByRLaDxMYWrcyQJp8U/4c9z+tsp/i8CzQCGx/xIydEci55num0TFxxx JoPWozoIEU9VEjM4zjlGOXrvKSdKxUJTg14oELXw= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200116140916eucas1p17fbbeae2a88748fb6bf266b90dc4b20f~qY0Jypy2u0480104801eucas1p1f; Thu, 16 Jan 2020 14:09:16 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 01.FD.60698.C8E602E5; Thu, 16 Jan 2020 14:09:16 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200116140916eucas1p1a6aff99bd371c4e23b1cc287bc3c42a8~qY0JcT-L61322413224eucas1p1M; Thu, 16 Jan 2020 14:09:16 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200116140916eusmtrp2a95c5395f891c76eb43b800c1df445e1~qY0JbtfUU0965509655eusmtrp2E; Thu, 16 Jan 2020 14:09:16 +0000 (GMT) X-AuditID: cbfec7f5-a0fff7000001ed1a-ac-5e206e8c3668 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 0A.FF.08375.B8E602E5; Thu, 16 Jan 2020 14:09:15 +0000 (GMT) Received: from AMDC3058.digital.local (unknown [106.120.51.71]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200116140915eusmtip10e5cd09bce3a469d76cf14e2fafd4e9b~qY0JKEJyx0239902399eusmtip1C; Thu, 16 Jan 2020 14:09:15 +0000 (GMT) From: Bartlomiej Zolnierkiewicz To: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Andrzej Hajda , b.zolnierkie@samsung.com Subject: [PATCH 4/6] video: fbdev: controlfb: remove function prototypes part #1 Date: Thu, 16 Jan 2020 15:08:58 +0100 Message-Id: <20200116140900.26363-5-b.zolnierkie@samsung.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200116140900.26363-1-b.zolnierkie@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupgleLIzCtJLcpLzFFi42LZduznOd2ePIU4gxXLRS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2PtnUdMBQtFKl48nMHUwDhTsIuRk0NC wERi9YFtbF2MXBxCAksZJd5NnczUxcgBlJCROL6+DKJGWOLPtS42EFtI4BOjxIvL2iA2m4CV xMT2VYwgtohAkkRnw0lmEJtZwFli1q1HTCC2sECAxJMV7WA2i4CqxJlLjSwgNq+ArcS3ljWM EPPlJbZ++8QKYnMK2EnMO3WPEeQEIaCaQ9OkIMoFJU7OfMICMV5eonnrbOYJjAKzkKRmIUkt YGRaxSiSWlqcm55bbKhXnJhbXJqXrpecn7uJERjm24793LyD8dLG4EOMAhyMSjy8M4IU4oRY E8uKK3MPMUpwMCuJ8J6cIRsnxJuSWFmVWpQfX1Sak1p8iNEU6IeJzFKiyfnAGMwriTc0NTS3 sDQ0NzY3NrNQEuftEDgYIySQnliSmp2aWpBaBNPHxMEp1cDYEilzJNvplYLl6ZzF01Xm6m6Y 6xX2qSigY+tOy9A+FRXb2IvdU52ubPc6OvvZhMWJTQtaXm3aHjn/culSvstbt/N52+70E7ql yGJwSJH54Z+9bZtd73lP4hLanXPptVZk6tJZT7hNPt47f/72vQ0pPaeCAsvVFGN7zTsWqfj9 WlIbbRZt4FSkxFKckWioxVxUnAgAGFA7sIkCAAA= X-CMS-MailID: 20200116140916eucas1p1a6aff99bd371c4e23b1cc287bc3c42a8 X-Msg-Generator: CA X-RootMTR: 20200116140916eucas1p1a6aff99bd371c4e23b1cc287bc3c42a8 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200116140916eucas1p1a6aff99bd371c4e23b1cc287bc3c42a8 References: <20200116140900.26363-1-b.zolnierkie@samsung.com> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org Reorder code a bit and then remove no longer needed function prototypes. Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/video/fbdev/controlfb.c | 41 +++++++++++---------------------- 1 file changed, 13 insertions(+), 28 deletions(-) diff --git a/drivers/video/fbdev/controlfb.c b/drivers/video/fbdev/controlfb.c index 87cd817ad4c6..32ee6e4b5db4 100644 --- a/drivers/video/fbdev/controlfb.c +++ b/drivers/video/fbdev/controlfb.c @@ -129,20 +129,6 @@ struct fb_info_control { #define CNTRL_REG(INFO,REG) (&(((INFO)->control_regs->REG).r)) -/******************** Prototypes for exported functions ********************/ -/* - * struct fb_ops - */ -static int controlfb_pan_display(struct fb_var_screeninfo *var, - struct fb_info *info); -static int controlfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, - u_int transp, struct fb_info *info); -static int controlfb_blank(int blank_mode, struct fb_info *info); -static int controlfb_mmap(struct fb_info *info, - struct vm_area_struct *vma); -static int controlfb_set_par (struct fb_info *info); -static int controlfb_check_var (struct fb_var_screeninfo *var, struct fb_info *info); - /******************** Prototypes for internal functions **********************/ static void set_control_clock(unsigned char *params); @@ -169,20 +155,6 @@ static int default_vmode __initdata = VMODE_NVRAM; static int default_cmode __initdata = CMODE_NVRAM; -static const struct fb_ops controlfb_ops = { - .owner = THIS_MODULE, - .fb_check_var = controlfb_check_var, - .fb_set_par = controlfb_set_par, - .fb_setcolreg = controlfb_setcolreg, - .fb_pan_display = controlfb_pan_display, - .fb_blank = controlfb_blank, - .fb_mmap = controlfb_mmap, - .fb_fillrect = cfb_fillrect, - .fb_copyarea = cfb_copyarea, - .fb_imageblit = cfb_imageblit, -}; - - /******************** The functions for controlfb_ops ********************/ /* @@ -1014,6 +986,19 @@ static inline void control_par_to_var(struct fb_par_control *par, var->pixclock >>= par->regvals.clock_params[2]; } +static const struct fb_ops controlfb_ops = { + .owner = THIS_MODULE, + .fb_check_var = controlfb_check_var, + .fb_set_par = controlfb_set_par, + .fb_setcolreg = controlfb_setcolreg, + .fb_pan_display = controlfb_pan_display, + .fb_blank = controlfb_blank, + .fb_mmap = controlfb_mmap, + .fb_fillrect = cfb_fillrect, + .fb_copyarea = cfb_copyarea, + .fb_imageblit = cfb_imageblit, +}; + /* * Set misc info vars for this driver */ From patchwork Thu Jan 16 14:08:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 11337109 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 01A4192A for ; Thu, 16 Jan 2020 14:09:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B634E2077C for ; Thu, 16 Jan 2020 14:09:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="YrCjIFki" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726857AbgAPOJ3 (ORCPT ); Thu, 16 Jan 2020 09:09:29 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:50646 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726867AbgAPOJT (ORCPT ); Thu, 16 Jan 2020 09:09:19 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200116140917euoutp01d06c31fc8a8dd250bc97052f72239d8d~qY0Kc7FDO0495004950euoutp01l for ; Thu, 16 Jan 2020 14:09:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200116140917euoutp01d06c31fc8a8dd250bc97052f72239d8d~qY0Kc7FDO0495004950euoutp01l DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1579183757; bh=UjI7pq402iq5pI3T/IpsVyHBFogV/jA6cdkYrAOJUDo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YrCjIFkiTE8whvokbTpIh794KDQwmjpK6EFfPRvaRegwdGzHUfJZLpmiJy8FIVFgm UMRjjW3lAjtG6Wr7MXieJ7haD5PgZbcbWXbw5Z/zWz10XIMhHWx5qbkgtfT1EkBiwn wFOjO1u9AX+EnhCS5tj2RDkr+4p9uU9zf19BAIeE= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200116140916eucas1p202c94aa1429b4ae8a0d1ffa67dd9916c~qY0KPxfkq1059310593eucas1p2t; Thu, 16 Jan 2020 14:09:16 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id C1.FD.60698.C8E602E5; Thu, 16 Jan 2020 14:09:16 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200116140916eucas1p112ff962e85e6feb4dbc2ff65443ef1ce~qY0JwVXu30480504805eucas1p18; Thu, 16 Jan 2020 14:09:16 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200116140916eusmtrp26285d011ced2952841245f69eea2ace3~qY0Jvylh50965509655eusmtrp2G; Thu, 16 Jan 2020 14:09:16 +0000 (GMT) X-AuditID: cbfec7f5-a0fff7000001ed1a-ae-5e206e8ccefd Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id AA.FF.08375.C8E602E5; Thu, 16 Jan 2020 14:09:16 +0000 (GMT) Received: from AMDC3058.digital.local (unknown [106.120.51.71]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200116140916eusmtip1c274cd474e09869132dc019be1338c43~qY0Jb-Pzk0665806658eusmtip1Z; Thu, 16 Jan 2020 14:09:15 +0000 (GMT) From: Bartlomiej Zolnierkiewicz To: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Andrzej Hajda , b.zolnierkie@samsung.com Subject: [PATCH 5/6] video: fbdev: controlfb: remove function prototypes part #2 Date: Thu, 16 Jan 2020 15:08:59 +0100 Message-Id: <20200116140900.26363-6-b.zolnierkie@samsung.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200116140900.26363-1-b.zolnierkie@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupgleLIzCtJLcpLzFFi42LZduzned2ePIU4g+NfdS1urTvHarFxxnpW iytf37NZnOj7wGpxedccNgdWj/vdx5k8+rasYvT4vEkugDmKyyYlNSezLLVI3y6BK+Nvx3PW ghfpFT9fXmduYJwR3MXIwSEhYCKx9a5HFyMXh5DACkaJE0ufs0A4Xxgldn5fxdzFyAnkfGaU eD2LG8QGafgz8zcbRNFyRomJt08zwXUcaGhnAqliE7CSmNi+ihHEFhFIkFgxfQYjyDpmAUeJ 5n4+kLCwQJBE2/5N7CA2i4CqROeJXjCbV8BWYvevV+wQy+Qltn77xApicwrYScw7dY8RokZQ 4uTMJywgNjNQTfPW2cwgN0gIfGeTuHavlwmi2UXiY888RghbWOLV8S1QQ2Uk/u+czwTRsI5R 4m/HC6ju7YwSyyf/Y4Oospa4c+4XG8TVmhLrd+lDhB0lnv8+zQgJOz6JG28FIY7gk5i0bToz RJhXoqNNCKJaTWLDsg1sMGu7dq6EKvGQ6PtoPYFRcRaSb2Yh+WYWwtoFjMyrGMVTS4tz01OL jfNSy/WKE3OLS/PS9ZLzczcxAtPH6X/Hv+5g3Pcn6RCjAAejEg/vhxCFOCHWxLLiytxDjBIc zEoivCdnyMYJ8aYkVlalFuXHF5XmpBYfYpTmYFES5zVe9DJWSCA9sSQ1OzW1ILUIJsvEwSnV wFiVet31esRu+6gZgvwXNoh1XRI5+2NZb0bBnlyB0slvfffNadf/JPbY7PW3iWFSym2HLfSn L7HfcqXQQu5QxoLF2s7XfCdU/kw8NOV7VojsNIkDb4p3apdL/yqxKj3h/9fe3vX9jrUK6r5T LBhPt8Uy+x2T+KB9WS+gu6Dz9IMo02RG82cxW5VYijMSDbWYi4oTAcuZFWUbAwAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrGLMWRmVeSWpSXmKPExsVy+t/xu7o9eQpxBrMuCVrcWneO1WLjjPWs Fle+vmezONH3gdXi8q45bA6sHve7jzN59G1ZxejxeZNcAHOUnk1RfmlJqkJGfnGJrVK0oYWR nqGlhZ6RiaWeobF5rJWRqZK+nU1Kak5mWWqRvl2CXsbfjuesBS/SK36+vM7cwDgjuIuRk0NC wETiz8zfbF2MXBxCAksZJT4+PsDYxcgBlJCROL6+DKJGWOLPtS6omk+MEnN7NrKDJNgErCQm tq9iBLFFBJIkOhtOMoPYzALOErNuPWICmSMsECBx/DcLSJhFQFWi80QvWCuvgK3E7l+v2CHm y0ts/faJFcTmFLCTmHfqHtgJQkA1h6ZJQZQLSpyc+YQFYrq8RPPW2cwTGAVmIUnNQpJawMi0 ilEktbQ4Nz232FCvODG3uDQvXS85P3cTIzDMtx37uXkH46WNwYcYBTgYlXh4ZwQpxAmxJpYV V+YeYpTgYFYS4T05QzZOiDclsbIqtSg/vqg0J7X4EKMp0A8TmaVEk/OBMZhXEm9oamhuYWlo bmxubGahJM7bIXAwRkggPbEkNTs1tSC1CKaPiYNTqoFRrnxD/JWoi3NufrNWmPBr55RbO+78 2nrsz96AuJssErvflkx7rLnIJXpFee4O26/7drS9nHHpkrDjvnL32OmP4lU/Bsw5uIxH3F9Z waYqiLvowNPoxfqMtq+mLNw7RXPyycC05V8fzk0Wdfijuen5CdvqgN0lf8wnWmUqzpU8fvuN 66uV60QiNiqxFGckGmoxFxUnAgCzPc7UiQIAAA== X-CMS-MailID: 20200116140916eucas1p112ff962e85e6feb4dbc2ff65443ef1ce X-Msg-Generator: CA X-RootMTR: 20200116140916eucas1p112ff962e85e6feb4dbc2ff65443ef1ce X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200116140916eucas1p112ff962e85e6feb4dbc2ff65443ef1ce References: <20200116140900.26363-1-b.zolnierkie@samsung.com> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org Reorder code a bit and then remove no longer needed function prototypes. Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/video/fbdev/controlfb.c | 410 +++++++++++++++----------------- 1 file changed, 198 insertions(+), 212 deletions(-) diff --git a/drivers/video/fbdev/controlfb.c b/drivers/video/fbdev/controlfb.c index 32ee6e4b5db4..4012ecf72d47 100644 --- a/drivers/video/fbdev/controlfb.c +++ b/drivers/video/fbdev/controlfb.c @@ -131,20 +131,12 @@ struct fb_info_control { /******************** Prototypes for internal functions **********************/ -static void set_control_clock(unsigned char *params); -static int init_control(struct fb_info_control *p); static void control_set_hardware(struct fb_info_control *p, struct fb_par_control *par); -static int control_of_init(struct device_node *dp); -static void find_vram_size(struct fb_info_control *p); -static int read_control_sense(struct fb_info_control *p); -static int calc_clock_params(unsigned long clk, unsigned char *param); static int control_var_to_par(struct fb_var_screeninfo *var, struct fb_par_control *par, const struct fb_info *fb_info); static inline void control_par_to_var(struct fb_par_control *par, struct fb_var_screeninfo *var); -static void control_init_info(struct fb_info *info, struct fb_info_control *p); -static void control_cleanup(void); /************************** Internal variables *******************************/ @@ -360,77 +352,6 @@ static void set_control_clock(unsigned char *params) #endif } - -/* - * finish off the driver initialization and register - */ -static int __init init_control(struct fb_info_control *p) -{ - int full, sense, vmode, cmode, vyres; - struct fb_var_screeninfo var; - int rc; - - printk(KERN_INFO "controlfb: "); - - full = p->total_vram == 0x400000; - - /* Try to pick a video mode out of NVRAM if we have one. */ - cmode = default_cmode; - if (IS_REACHABLE(CONFIG_NVRAM) && cmode == CMODE_NVRAM) - cmode = nvram_read_byte(NV_CMODE); - if (cmode < CMODE_8 || cmode > CMODE_32) - cmode = CMODE_8; - - vmode = default_vmode; - if (IS_REACHABLE(CONFIG_NVRAM) && vmode == VMODE_NVRAM) - vmode = nvram_read_byte(NV_VMODE); - if (vmode < 1 || vmode > VMODE_MAX || - control_mac_modes[vmode - 1].m[full] < cmode) { - sense = read_control_sense(p); - printk(KERN_CONT "Monitor sense value = 0x%x, ", sense); - vmode = mac_map_monitor_sense(sense); - if (control_mac_modes[vmode - 1].m[full] < 0) - vmode = VMODE_640_480_60; - cmode = min(cmode, control_mac_modes[vmode - 1].m[full]); - } - - /* Initialize info structure */ - control_init_info(&p->info, p); - - /* Setup default var */ - if (mac_vmode_to_var(vmode, cmode, &var) < 0) { - /* This shouldn't happen! */ - printk("mac_vmode_to_var(%d, %d,) failed\n", vmode, cmode); -try_again: - vmode = VMODE_640_480_60; - cmode = CMODE_8; - if (mac_vmode_to_var(vmode, cmode, &var) < 0) { - printk(KERN_ERR "controlfb: mac_vmode_to_var() failed\n"); - return -ENXIO; - } - printk(KERN_INFO "controlfb: "); - } - printk("using video mode %d and color mode %d.\n", vmode, cmode); - - vyres = (p->total_vram - CTRLFB_OFF) / (var.xres << cmode); - if (vyres > var.yres) - var.yres_virtual = vyres; - - /* Apply default var */ - var.activate = FB_ACTIVATE_NOW; - rc = fb_set_var(&p->info, &var); - if (rc && (vmode != VMODE_640_480_60 || cmode != CMODE_8)) - goto try_again; - - /* Register with fbdev layer */ - if (register_framebuffer(&p->info) < 0) - return -ENXIO; - - fb_info(&p->info, "control display adapter\n"); - - return 0; -} - #define RADACAL_WRITE(a,d) \ out_8(&p->cmap_regs->addr, (a)); \ out_8(&p->cmap_regs->dat, (d)) @@ -492,67 +413,6 @@ static void control_set_hardware(struct fb_info_control *p, struct fb_par_contro #endif /* CONFIG_BOOTX_TEXT */ } - -/* - * Parse user specified options (`video=controlfb:') - */ -static void __init control_setup(char *options) -{ - char *this_opt; - - if (!options || !*options) - return; - - while ((this_opt = strsep(&options, ",")) != NULL) { - if (!strncmp(this_opt, "vmode:", 6)) { - int vmode = simple_strtoul(this_opt+6, NULL, 0); - if (vmode > 0 && vmode <= VMODE_MAX && - control_mac_modes[vmode - 1].m[1] >= 0) - default_vmode = vmode; - } else if (!strncmp(this_opt, "cmode:", 6)) { - int depth = simple_strtoul(this_opt+6, NULL, 0); - switch (depth) { - case CMODE_8: - case CMODE_16: - case CMODE_32: - default_cmode = depth; - break; - case 8: - default_cmode = CMODE_8; - break; - case 15: - case 16: - default_cmode = CMODE_16; - break; - case 24: - case 32: - default_cmode = CMODE_32; - break; - } - } - } -} - -static int __init control_init(void) -{ - struct device_node *dp; - char *option = NULL; - int ret = -ENXIO; - - if (fb_get_options("controlfb", &option)) - return -ENODEV; - control_setup(option); - - dp = of_find_node_by_name(NULL, "control"); - if (dp && !control_of_init(dp)) - ret = 0; - of_node_put(dp); - - return ret; -} - -device_initcall(control_init); - /* Work out which banks of VRAM we have installed. */ /* danj: I guess the card just ignores writes to nonexistant VRAM... */ @@ -629,78 +489,6 @@ static void __init find_vram_size(struct fb_info_control *p) (bank1 + bank2) << 1, bank1 << 1, bank2 << 1); } - -/* - * find "control" and initialize - */ -static int __init control_of_init(struct device_node *dp) -{ - struct fb_info_control *p; - struct resource fb_res, reg_res; - - if (control_fb) { - printk(KERN_ERR "controlfb: only one control is supported\n"); - return -ENXIO; - } - - if (of_pci_address_to_resource(dp, 2, &fb_res) || - of_pci_address_to_resource(dp, 1, ®_res)) { - printk(KERN_ERR "can't get 2 addresses for control\n"); - return -ENXIO; - } - p = kzalloc(sizeof(*p), GFP_KERNEL); - if (!p) - return -ENOMEM; - control_fb = p; /* save it for cleanups */ - - /* Map in frame buffer and registers */ - p->fb_orig_base = fb_res.start; - p->fb_orig_size = resource_size(&fb_res); - /* use the big-endian aperture (??) */ - p->frame_buffer_phys = fb_res.start + 0x800000; - p->control_regs_phys = reg_res.start; - p->control_regs_size = resource_size(®_res); - - if (!p->fb_orig_base || - !request_mem_region(p->fb_orig_base,p->fb_orig_size,"controlfb")) { - p->fb_orig_base = 0; - goto error_out; - } - /* map at most 8MB for the frame buffer */ - p->frame_buffer = ioremap_wt(p->frame_buffer_phys, 0x800000); - - if (!p->control_regs_phys || - !request_mem_region(p->control_regs_phys, p->control_regs_size, - "controlfb regs")) { - p->control_regs_phys = 0; - goto error_out; - } - p->control_regs = ioremap(p->control_regs_phys, p->control_regs_size); - - p->cmap_regs_phys = 0xf301b000; /* XXX not in prom? */ - if (!request_mem_region(p->cmap_regs_phys, 0x1000, "controlfb cmap")) { - p->cmap_regs_phys = 0; - goto error_out; - } - p->cmap_regs = ioremap(p->cmap_regs_phys, 0x1000); - - if (!p->cmap_regs || !p->control_regs || !p->frame_buffer) - goto error_out; - - find_vram_size(p); - if (!p->total_vram) - goto error_out; - - if (init_control(p) < 0) - goto error_out; - - return 0; - -error_out: - control_cleanup(); - return -ENXIO; -} - /* * Get the monitor sense value. * Note that this can be called before calibrate_delay, @@ -1025,6 +813,115 @@ static void __init control_init_info(struct fb_info *info, struct fb_info_contro info->fix.accel = FB_ACCEL_NONE; } +/* + * Parse user specified options (`video=controlfb:') + */ +static void __init control_setup(char *options) +{ + char *this_opt; + + if (!options || !*options) + return; + + while ((this_opt = strsep(&options, ",")) != NULL) { + if (!strncmp(this_opt, "vmode:", 6)) { + int vmode = simple_strtoul(this_opt+6, NULL, 0); + if (vmode > 0 && vmode <= VMODE_MAX && + control_mac_modes[vmode - 1].m[1] >= 0) + default_vmode = vmode; + } else if (!strncmp(this_opt, "cmode:", 6)) { + int depth = simple_strtoul(this_opt+6, NULL, 0); + switch (depth) { + case CMODE_8: + case CMODE_16: + case CMODE_32: + default_cmode = depth; + break; + case 8: + default_cmode = CMODE_8; + break; + case 15: + case 16: + default_cmode = CMODE_16; + break; + case 24: + case 32: + default_cmode = CMODE_32; + break; + } + } + } +} + +/* + * finish off the driver initialization and register + */ +static int __init init_control(struct fb_info_control *p) +{ + int full, sense, vmode, cmode, vyres; + struct fb_var_screeninfo var; + int rc; + + printk(KERN_INFO "controlfb: "); + + full = p->total_vram == 0x400000; + + /* Try to pick a video mode out of NVRAM if we have one. */ + cmode = default_cmode; + if (IS_REACHABLE(CONFIG_NVRAM) && cmode == CMODE_NVRAM) + cmode = nvram_read_byte(NV_CMODE); + if (cmode < CMODE_8 || cmode > CMODE_32) + cmode = CMODE_8; + + vmode = default_vmode; + if (IS_REACHABLE(CONFIG_NVRAM) && vmode == VMODE_NVRAM) + vmode = nvram_read_byte(NV_VMODE); + if (vmode < 1 || vmode > VMODE_MAX || + control_mac_modes[vmode - 1].m[full] < cmode) { + sense = read_control_sense(p); + printk(KERN_CONT "Monitor sense value = 0x%x, ", sense); + vmode = mac_map_monitor_sense(sense); + if (control_mac_modes[vmode - 1].m[full] < 0) + vmode = VMODE_640_480_60; + cmode = min(cmode, control_mac_modes[vmode - 1].m[full]); + } + + /* Initialize info structure */ + control_init_info(&p->info, p); + + /* Setup default var */ + if (mac_vmode_to_var(vmode, cmode, &var) < 0) { + /* This shouldn't happen! */ + printk("mac_vmode_to_var(%d, %d,) failed\n", vmode, cmode); +try_again: + vmode = VMODE_640_480_60; + cmode = CMODE_8; + if (mac_vmode_to_var(vmode, cmode, &var) < 0) { + printk(KERN_ERR "controlfb: mac_vmode_to_var() failed\n"); + return -ENXIO; + } + printk(KERN_INFO "controlfb: "); + } + printk("using video mode %d and color mode %d.\n", vmode, cmode); + + vyres = (p->total_vram - CTRLFB_OFF) / (var.xres << cmode); + if (vyres > var.yres) + var.yres_virtual = vyres; + + /* Apply default var */ + var.activate = FB_ACTIVATE_NOW; + rc = fb_set_var(&p->info, &var); + if (rc && (vmode != VMODE_640_480_60 || cmode != CMODE_8)) + goto try_again; + + /* Register with fbdev layer */ + if (register_framebuffer(&p->info) < 0) + return -ENXIO; + + fb_info(&p->info, "control display adapter\n"); + + return 0; +} static void control_cleanup(void) { @@ -1051,4 +948,93 @@ static void control_cleanup(void) kfree(p); } +/* + * find "control" and initialize + */ +static int __init control_of_init(struct device_node *dp) +{ + struct fb_info_control *p; + struct resource fb_res, reg_res; + + if (control_fb) { + printk(KERN_ERR "controlfb: only one control is supported\n"); + return -ENXIO; + } + + if (of_pci_address_to_resource(dp, 2, &fb_res) || + of_pci_address_to_resource(dp, 1, ®_res)) { + printk(KERN_ERR "can't get 2 addresses for control\n"); + return -ENXIO; + } + p = kzalloc(sizeof(*p), GFP_KERNEL); + if (!p) + return -ENOMEM; + control_fb = p; /* save it for cleanups */ + + /* Map in frame buffer and registers */ + p->fb_orig_base = fb_res.start; + p->fb_orig_size = resource_size(&fb_res); + /* use the big-endian aperture (??) */ + p->frame_buffer_phys = fb_res.start + 0x800000; + p->control_regs_phys = reg_res.start; + p->control_regs_size = resource_size(®_res); + + if (!p->fb_orig_base || + !request_mem_region(p->fb_orig_base,p->fb_orig_size,"controlfb")) { + p->fb_orig_base = 0; + goto error_out; + } + /* map at most 8MB for the frame buffer */ + p->frame_buffer = ioremap_wt(p->frame_buffer_phys, 0x800000); + + if (!p->control_regs_phys || + !request_mem_region(p->control_regs_phys, p->control_regs_size, + "controlfb regs")) { + p->control_regs_phys = 0; + goto error_out; + } + p->control_regs = ioremap(p->control_regs_phys, p->control_regs_size); + + p->cmap_regs_phys = 0xf301b000; /* XXX not in prom? */ + if (!request_mem_region(p->cmap_regs_phys, 0x1000, "controlfb cmap")) { + p->cmap_regs_phys = 0; + goto error_out; + } + p->cmap_regs = ioremap(p->cmap_regs_phys, 0x1000); + + if (!p->cmap_regs || !p->control_regs || !p->frame_buffer) + goto error_out; + + find_vram_size(p); + if (!p->total_vram) + goto error_out; + + if (init_control(p) < 0) + goto error_out; + + return 0; + +error_out: + control_cleanup(); + return -ENXIO; +} + +static int __init control_init(void) +{ + struct device_node *dp; + char *option = NULL; + int ret = -ENXIO; + if (fb_get_options("controlfb", &option)) + return -ENODEV; + control_setup(option); + + dp = of_find_node_by_name(NULL, "control"); + if (dp && !control_of_init(dp)) + ret = 0; + of_node_put(dp); + + return ret; +} + +device_initcall(control_init); From patchwork Thu Jan 16 14:09:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 11337117 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 41AB192A for ; Thu, 16 Jan 2020 14:09:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0739A207E0 for ; Thu, 16 Jan 2020 14:09:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="lfdA8L3M" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727012AbgAPOJa (ORCPT ); Thu, 16 Jan 2020 09:09:30 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:50649 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726908AbgAPOJT (ORCPT ); Thu, 16 Jan 2020 09:09:19 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200116140917euoutp01b4cf8964fdd392c7c2ca6d64b7f720f3~qY0Kye08y0369803698euoutp01P for ; Thu, 16 Jan 2020 14:09:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200116140917euoutp01b4cf8964fdd392c7c2ca6d64b7f720f3~qY0Kye08y0369803698euoutp01P DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1579183757; bh=hpgw6xnVEWj+E/Pyg9EDeM6sLEMaetg0XhqQOF1Ravk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lfdA8L3MqjAn4KlFojNgxkuF8+x8Tj2lV+V6c0kCjeoNxWre96swmsCDz7OR0OV4I N+kYYUEtV/eX3SC+0uBfmGGDeZYdTcRbKNyWp6USm9JXJt4icibyBrp/Rmy5rQt/QA In/tuWfxTwnhHNVgdMr5wlzH9L9q8wct/6T5powQ= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200116140917eucas1p1d640595b59ab2a8f67765c3873bc61bf~qY0KczGcV1322413224eucas1p1O; Thu, 16 Jan 2020 14:09:17 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 8D.FD.60679.C8E602E5; Thu, 16 Jan 2020 14:09:17 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200116140916eucas1p2bd3480995a55fdc646481a8fa5a5aff3~qY0KCTod32425224252eucas1p27; Thu, 16 Jan 2020 14:09:16 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200116140916eusmtrp2bf28e8ece2286e3860f47641f36a9439~qY0KBtxrl0965509655eusmtrp2H; Thu, 16 Jan 2020 14:09:16 +0000 (GMT) X-AuditID: cbfec7f4-0cbff7000001ed07-51-5e206e8c3e51 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 0B.FF.08375.C8E602E5; Thu, 16 Jan 2020 14:09:16 +0000 (GMT) Received: from AMDC3058.digital.local (unknown [106.120.51.71]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200116140916eusmtip139c44590ab708c090249338a68ceb2be~qY0Jt7Ymx0711307113eusmtip1C; Thu, 16 Jan 2020 14:09:16 +0000 (GMT) From: Bartlomiej Zolnierkiewicz To: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Andrzej Hajda , b.zolnierkie@samsung.com Subject: [PATCH 6/6] video: fbdev: controlfb: remove function prototypes part #3 Date: Thu, 16 Jan 2020 15:09:00 +0100 Message-Id: <20200116140900.26363-7-b.zolnierkie@samsung.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200116140900.26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6sHve7jzN59G1ZxejxeZNcAHOUnk1RfmlJqkJGfnGJrVK0oYWR nqGlhZ6RiaWeobF5rJWRqZK+nU1Kak5mWWqRvl2CXsaM6T4F/9wrlvx9ytjA+NOyi5GTQ0LA RGLi7NcsXYxcHEICSxklJp48xtTFyAGUkJE4vr4MokZY4s+1LjaImk+MEsdvtbGDJNgErCQm tq9iBLFFBJIkOhtOMoPYzALOErNuPWICsYUFAiQutHWzgdgsAqoS3ydA2LwCthL/vm9ih1gg L7H12ydWEJtTwE5i3ql7jCA3CAHVHJomBVEuKHFy5hMWiPHyEs1bZzNPYBSYhSQ1C0lqASPT KkaR1NLi3PTcYkO94sTc4tK8dL3k/NxNjMAw33bs5+YdjJc2Bh9iFOBgVOLhnRGkECfEmlhW XJl7iFGCg1lJhPfkDNk4Id6UxMqq1KL8+KLSnNTiQ4ymQD9MZJYSTc4HxmBeSbyhqaG5haWh ubG5sZmFkjhvh8DBGCGB9MSS1OzU1ILUIpg+Jg5OqQZGL71Tl2Qjsmy1N1VtszHe8Kjy6smZ M4LYp0uuY4x453wp5fuvwP2CHdzJd+5urfU/c+xe6qLEzdJlMv0PFx0pKniS0/PphcK9hEqG A/Y5GuE3y5r9P5vrzhK3ivp9w7741kbO6x/0V/zdcNV+yYxPLFzaEb/XmMxQjf8/I8x6Ye+/ pZzdvE6zlViKMxINtZiLihMBmJZlOYkCAAA= X-CMS-MailID: 20200116140916eucas1p2bd3480995a55fdc646481a8fa5a5aff3 X-Msg-Generator: CA X-RootMTR: 20200116140916eucas1p2bd3480995a55fdc646481a8fa5a5aff3 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200116140916eucas1p2bd3480995a55fdc646481a8fa5a5aff3 References: <20200116140900.26363-1-b.zolnierkie@samsung.com> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org Reorder code a bit and then remove no longer needed function prototypes. Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/video/fbdev/controlfb.c | 306 +++++++++++++++----------------- 1 file changed, 147 insertions(+), 159 deletions(-) diff --git a/drivers/video/fbdev/controlfb.c b/drivers/video/fbdev/controlfb.c index 4012ecf72d47..e71192ee5650 100644 --- a/drivers/video/fbdev/controlfb.c +++ b/drivers/video/fbdev/controlfb.c @@ -129,16 +129,6 @@ struct fb_info_control { #define CNTRL_REG(INFO,REG) (&(((INFO)->control_regs->REG).r)) -/******************** Prototypes for internal functions **********************/ - -static void control_set_hardware(struct fb_info_control *p, - struct fb_par_control *par); -static int control_var_to_par(struct fb_var_screeninfo *var, - struct fb_par_control *par, const struct fb_info *fb_info); -static inline void control_par_to_var(struct fb_par_control *par, - struct fb_var_screeninfo *var); - - /************************** Internal variables *******************************/ static struct fb_info_control *control_fb; @@ -147,155 +137,6 @@ static int default_vmode __initdata = VMODE_NVRAM; static int default_cmode __initdata = CMODE_NVRAM; -/******************** The functions for controlfb_ops ********************/ - -/* - * Checks a var structure - */ -static int controlfb_check_var (struct fb_var_screeninfo *var, struct fb_info *info) -{ - struct fb_par_control par; - int err; - - err = control_var_to_par(var, &par, info); - if (err) - return err; - control_par_to_var(&par, var); - - return 0; -} - -/* - * Applies current var to display - */ -static int controlfb_set_par (struct fb_info *info) -{ - struct fb_info_control *p = - container_of(info, struct fb_info_control, info); - struct fb_par_control par; - int err; - - if((err = control_var_to_par(&info->var, &par, info))) { - printk (KERN_ERR "controlfb_set_par: error calling" - " control_var_to_par: %d.\n", err); - return err; - } - - control_set_hardware(p, &par); - - info->fix.visual = (p->par.cmode == CMODE_8) ? - FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_DIRECTCOLOR; - info->fix.line_length = p->par.pitch; - info->fix.xpanstep = 32 >> p->par.cmode; - info->fix.ypanstep = 1; - - return 0; -} - -/* - * Set screen start address according to var offset values - */ -static inline void set_screen_start(int xoffset, int yoffset, - struct fb_info_control *p) -{ - struct fb_par_control *par = &p->par; - - par->xoffset = xoffset; - par->yoffset = yoffset; - out_le32(CNTRL_REG(p,start_addr), - par->yoffset * par->pitch + (par->xoffset << par->cmode)); -} - - -static int controlfb_pan_display(struct fb_var_screeninfo *var, - struct fb_info *info) -{ - unsigned int xoffset, hstep; - struct fb_info_control *p = - container_of(info, struct fb_info_control, info); - struct fb_par_control *par = &p->par; - - /* - * make sure start addr will be 32-byte aligned - */ - hstep = 0x1f >> par->cmode; - xoffset = (var->xoffset + hstep) & ~hstep; - - if (xoffset+par->xres > par->vxres || - var->yoffset+par->yres > par->vyres) - return -EINVAL; - - set_screen_start(xoffset, var->yoffset, p); - - return 0; -} - - -/* - * Private mmap since we want to have a different caching on the framebuffer - * for controlfb. - * Note there's no locking in here; it's done in fb_mmap() in fbmem.c. - */ -static int controlfb_mmap(struct fb_info *info, - struct vm_area_struct *vma) -{ - unsigned long mmio_pgoff; - unsigned long start; - u32 len; - - start = info->fix.smem_start; - len = info->fix.smem_len; - mmio_pgoff = PAGE_ALIGN((start & ~PAGE_MASK) + len) >> PAGE_SHIFT; - if (vma->vm_pgoff >= mmio_pgoff) { - if (info->var.accel_flags) - return -EINVAL; - vma->vm_pgoff -= mmio_pgoff; - start = info->fix.mmio_start; - len = info->fix.mmio_len; - vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); - } else { - /* framebuffer */ -#ifdef CONFIG_PPC_PMAC - vma->vm_page_prot = pgprot_cached_wthru(vma->vm_page_prot); -#endif - } - - return vm_iomap_memory(vma, start, len); -} - -static int controlfb_blank(int blank_mode, struct fb_info *info) -{ - struct fb_info_control *p = - container_of(info, struct fb_info_control, info); - unsigned ctrl; - - ctrl = le32_to_cpup((const __force __le32 *)CNTRL_REG(p, ctrl)); - if (blank_mode > 0) - switch (blank_mode) { - case FB_BLANK_VSYNC_SUSPEND: - ctrl &= ~3; - break; - case FB_BLANK_HSYNC_SUSPEND: - ctrl &= ~0x30; - break; - case FB_BLANK_POWERDOWN: - ctrl &= ~0x33; - /* fall through */ - case FB_BLANK_NORMAL: - ctrl |= 0x400; - break; - default: - break; - } - else { - ctrl &= ~0x400; - ctrl |= 0x33; - } - out_le32(CNTRL_REG(p,ctrl), ctrl); - - return 0; -} - static int controlfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, u_int transp, struct fb_info *info) { @@ -352,6 +193,20 @@ static void set_control_clock(unsigned char *params) #endif } +/* + * Set screen start address according to var offset values + */ +static inline void set_screen_start(int xoffset, int yoffset, + struct fb_info_control *p) +{ + struct fb_par_control *par = &p->par; + + par->xoffset = xoffset; + par->yoffset = yoffset; + out_le32(CNTRL_REG(p,start_addr), + par->yoffset * par->pitch + (par->xoffset << par->cmode)); +} + #define RADACAL_WRITE(a,d) \ out_8(&p->cmap_regs->addr, (a)); \ out_8(&p->cmap_regs->dat, (d)) @@ -774,6 +629,139 @@ static inline void control_par_to_var(struct fb_par_control *par, var->pixclock >>= par->regvals.clock_params[2]; } +/******************** The functions for controlfb_ops ********************/ + +/* + * Checks a var structure + */ +static int controlfb_check_var (struct fb_var_screeninfo *var, struct fb_info *info) +{ + struct fb_par_control par; + int err; + + err = control_var_to_par(var, &par, info); + if (err) + return err; + control_par_to_var(&par, var); + + return 0; +} + +/* + * Applies current var to display + */ +static int controlfb_set_par (struct fb_info *info) +{ + struct fb_info_control *p = + container_of(info, struct fb_info_control, info); + struct fb_par_control par; + int err; + + if((err = control_var_to_par(&info->var, &par, info))) { + printk (KERN_ERR "controlfb_set_par: error calling" + " control_var_to_par: %d.\n", err); + return err; + } + + control_set_hardware(p, &par); + + info->fix.visual = (p->par.cmode == CMODE_8) ? + FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_DIRECTCOLOR; + info->fix.line_length = p->par.pitch; + info->fix.xpanstep = 32 >> p->par.cmode; + info->fix.ypanstep = 1; + + return 0; +} + +static int controlfb_pan_display(struct fb_var_screeninfo *var, + struct fb_info *info) +{ + unsigned int xoffset, hstep; + struct fb_info_control *p = + container_of(info, struct fb_info_control, info); + struct fb_par_control *par = &p->par; + + /* + * make sure start addr will be 32-byte aligned + */ + hstep = 0x1f >> par->cmode; + xoffset = (var->xoffset + hstep) & ~hstep; + + if (xoffset+par->xres > par->vxres || + var->yoffset+par->yres > par->vyres) + return -EINVAL; + + set_screen_start(xoffset, var->yoffset, p); + + return 0; +} + +static int controlfb_blank(int blank_mode, struct fb_info *info) +{ + struct fb_info_control *p = + container_of(info, struct fb_info_control, info); + unsigned ctrl; + + ctrl = le32_to_cpup((const __force __le32 *)CNTRL_REG(p, ctrl)); + if (blank_mode > 0) + switch (blank_mode) { + case FB_BLANK_VSYNC_SUSPEND: + ctrl &= ~3; + break; + case FB_BLANK_HSYNC_SUSPEND: + ctrl &= ~0x30; + break; + case FB_BLANK_POWERDOWN: + ctrl &= ~0x33; + /* fall through */ + case FB_BLANK_NORMAL: + ctrl |= 0x400; + break; + default: + break; + } + else { + ctrl &= ~0x400; + ctrl |= 0x33; + } + out_le32(CNTRL_REG(p,ctrl), ctrl); + + return 0; +} + +/* + * Private mmap since we want to have a different caching on the framebuffer + * for controlfb. + * Note there's no locking in here; it's done in fb_mmap() in fbmem.c. + */ +static int controlfb_mmap(struct fb_info *info, + struct vm_area_struct *vma) +{ + unsigned long mmio_pgoff; + unsigned long start; + u32 len; + + start = info->fix.smem_start; + len = info->fix.smem_len; + mmio_pgoff = PAGE_ALIGN((start & ~PAGE_MASK) + len) >> PAGE_SHIFT; + if (vma->vm_pgoff >= mmio_pgoff) { + if (info->var.accel_flags) + return -EINVAL; + vma->vm_pgoff -= mmio_pgoff; + start = info->fix.mmio_start; + len = info->fix.mmio_len; + vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); + } else { + /* framebuffer */ +#ifdef CONFIG_PPC_PMAC + vma->vm_page_prot = pgprot_cached_wthru(vma->vm_page_prot); +#endif + } + + return vm_iomap_memory(vma, start, len); +} + static const struct fb_ops controlfb_ops = { .owner = THIS_MODULE, .fb_check_var = controlfb_check_var,