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: 1939821 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 2C8CBDF230 for ; Mon, 7 Jan 2013 06:11:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751068Ab3AGGLI (ORCPT ); Mon, 7 Jan 2013 01:11:08 -0500 Received: from arroyo.ext.ti.com ([192.94.94.40]:41754 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750776Ab3AGGLH (ORCPT ); Mon, 7 Jan 2013 01:11:07 -0500 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" CC: Rob Herring , "linux-fbdev@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , Laurent Pinchart , Thierry Reding , Guennady Liakhovetski , "linux-media@vger.kernel.org" , "Valkeinen, Tomi" , Stephen Warren , "kernel@pengutronix.de" , Florian Tobias Schandinat , David Airlie , Rob Clark , Leela Krishna Amudala 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 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.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);