From patchwork Mon Jan 7 06:10:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Afzal Mohammed X-Patchwork-Id: 1939871 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 477B43FE37 for ; Mon, 7 Jan 2013 06:39:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 04AEEE6848 for ; Sun, 6 Jan 2013 22:39:46 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 393 seconds by postgrey-1.32 at gabe; Sun, 06 Jan 2013 22:17:08 PST Received: from arroyo.ext.ti.com (arroyo.ext.ti.com [192.94.94.40]) by gabe.freedesktop.org (Postfix) with ESMTP id 26A83E5C94 for ; Sun, 6 Jan 2013 22:17:08 -0800 (PST) Received: from dbdp20.itg.ti.com ([172.24.170.38]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id r076AKBc003424; Mon, 7 Jan 2013 00:10:21 -0600 Received: from DBDE70.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id r076ADX1009630; Mon, 7 Jan 2013 11:40:14 +0530 (IST) Received: from DBDE01.ent.ti.com ([fe80::d5df:c4b5:9919:4e10]) by DBDE70.ent.ti.com ([fe80::2141:513f:409:315a%21]) with mapi id 14.01.0323.003; Mon, 7 Jan 2013 11:40:13 +0530 From: "Mohammed, Afzal" To: Steffen Trumtrar , "devicetree-discuss@lists.ozlabs.org" Subject: RE: [PATCHv16 5/7] fbmon: add of_videomode helpers Thread-Topic: [PATCHv16 5/7] fbmon: add of_videomode helpers Thread-Index: AQHN3UIFfnKTaycDZkuOLkjgeFCir5g9fYWQ Date: Mon, 7 Jan 2013 06:10:13 +0000 Message-ID: References: <1355850256-16135-1-git-send-email-s.trumtrar@pengutronix.de> <1355850256-16135-6-git-send-email-s.trumtrar@pengutronix.de> In-Reply-To: <1355850256-16135-6-git-send-email-s.trumtrar@pengutronix.de> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.24.170.142] MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 06 Jan 2013 22:33:04 -0800 Cc: "linux-fbdev@vger.kernel.org" , Stephen Warren , Florian Tobias Schandinat , "dri-devel@lists.freedesktop.org" , "Valkeinen, Tomi" , Rob Herring , Laurent Pinchart , "kernel@pengutronix.de" , Guennady Liakhovetski , "linux-media@vger.kernel.org" X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Hi Steffen, On Tue, Dec 18, 2012 at 22:34:14, Steffen Trumtrar wrote: > Add helper to get fb_videomode from devicetree. > drivers/video/fbmon.c | 42 ++++++++++++++++++++++++++++++++++++++++++ > include/linux/fb.h | 4 ++++ This breaks DaVinci (da8xx_omapl_defconfig), following change was required to get it build if OF_VIDEOMODE or/and FB_MODE_HELPERS is not defined. There may be better solutions, following was the one that was used by me to test this series. ---8<---------- ---8<---------- > +#if IS_ENABLED(CONFIG_OF_VIDEOMODE) As _OF_VIDEOMODE is a bool type CONFIG, isn't, #ifdef CONFIG_OF_VIDEOMODE sufficient ? Regards Afzal diff --git a/include/linux/fb.h b/include/linux/fb.h index 58b9860..0ce30d1 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -716,9 +716,19 @@ extern void fb_destroy_modedb(struct fb_videomode *modedb); extern int fb_find_mode_cvt(struct fb_videomode *mode, int margins, int rb); extern unsigned char *fb_ddc_read(struct i2c_adapter *adapter); +#if defined(CONFIG_OF_VIDEOMODE) && defined(CONFIG_FB_MODE_HELPERS) extern int of_get_fb_videomode(struct device_node *np, struct fb_videomode *fb, int index); +#else +static inline int of_get_fb_videomode(struct device_node *np, + struct fb_videomode *fb, + int index) +{ + return -EINVAL; +} +#endif + extern int fb_videomode_from_videomode(const struct videomode *vm, struct fb_videomode *fbmode);