From patchwork Fri Aug 30 12:37:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulrich Hecht X-Patchwork-Id: 2851971 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3E7F09F313 for ; Fri, 30 Aug 2013 12:40:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 25DB420418 for ; Fri, 30 Aug 2013 12:40:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 07047203AD for ; Fri, 30 Aug 2013 12:40:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756128Ab3H3MkG (ORCPT ); Fri, 30 Aug 2013 08:40:06 -0400 Received: from mail-ee0-f52.google.com ([74.125.83.52]:55332 "EHLO mail-ee0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756079Ab3H3MjQ (ORCPT ); Fri, 30 Aug 2013 08:39:16 -0400 Received: by mail-ee0-f52.google.com with SMTP id c41so872249eek.25 for ; Fri, 30 Aug 2013 05:39:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7L0aH73qS5wCo5AUk9jIphSYmr/TliizBWKZra1fL1Y=; b=vFhE2WMC+sjyHF/qgubbw+a/LRAyKqEE3619h+V6xxZokuqHZVzl2hJ9XCR5oGKk2g XjkTVs6lsitS+LgpVCPIq8eDyZFnkVfFITlWu41r8J6CLRz4Ml1a4613I/EKdeTy+Ulo 9woSbjezRQyuxsfCrtqIqSMIdxsUcCAmjV5FSxJjgWDgDV3BgLf4+JkqZD8YyUW7V+Tn ovp/nI0p8a4WV5XhRQ/er0B7VwqeYqe2Pk6DaNI6uQEhRci961pzMEUVHgSUOasMXRfQ Ufky/oJ74DNh3pl62uNpTjwQ8MX30wcYMUGiaNvV2IAv3g0TXcMpg9XWj5ae/902bCHJ weBQ== X-Received: by 10.15.26.7 with SMTP id m7mr3342003eeu.56.1377866355802; Fri, 30 Aug 2013 05:39:15 -0700 (PDT) Received: from groucho.site ([109.201.152.242]) by mx.google.com with ESMTPSA id j7sm54444384eeo.15.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 30 Aug 2013 05:39:14 -0700 (PDT) From: Ulrich Hecht To: linux-sh@vger.kernel.org Cc: magnus.damm@gmail.com, Ulrich Hecht Subject: [RFC 08/10] ARM: shmobile: r8a7790: lager: i2c support Date: Fri, 30 Aug 2013 14:37:42 +0200 Message-Id: <1377866264-21110-9-git-send-email-ulrich.hecht@gmail.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1377866264-21110-1-git-send-email-ulrich.hecht@gmail.com> References: <1377866264-21110-1-git-send-email-ulrich.hecht@gmail.com> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-8.9 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Enables the four i2c busses on the Lager board. Signed-off-by: Ulrich Hecht --- arch/arm/mach-shmobile/board-lager.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c index 4c3e694..c6b5f21 100644 --- a/arch/arm/mach-shmobile/board-lager.c +++ b/arch/arm/mach-shmobile/board-lager.c @@ -20,6 +20,7 @@ #include #include +#include #include #include #include @@ -171,6 +172,11 @@ static const struct pinctrl_map lager_pinctrl_map[] = { "du_sync_1", "du"), PIN_MAP_MUX_GROUP_DEFAULT("rcar-du-r8a7790", "pfc-r8a7790", "du_clk_out_0", "du"), + /* I2C */ + PIN_MAP_MUX_GROUP_DEFAULT("rcar-i2c.1", "pfc-r8a7790", + "i2c1", "i2c1"), + PIN_MAP_MUX_GROUP_DEFAULT("rcar-i2c.2", "pfc-r8a7790", + "i2c2", "i2c2"), /* SCIF0 (CN19: DEBUG SERIAL0) */ PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.6", "pfc-r8a7790", "scif0_data", "scif0"), @@ -193,6 +199,23 @@ static const struct pinctrl_map lager_pinctrl_map[] = { "intc_irq0", "intc"), }; +static struct i2c_board_info i2c2_devices[] = { + /* ak4643 at 0x12: no driver */ + { + I2C_BOARD_INFO("adv7180", 0x20), + }, + { + I2C_BOARD_INFO("adv7511", 0x39), + }, + /* adv7612 at 0x4c: no driver */ +}; + +/* I2C */ +static struct i2c_rcar_platform_data i2c_pdata = { + .bus_speed = 100000, + .flags = I2C_RCAR_FLAGS_ICCCR_IS_3BIT, +}; + static void __init lager_add_standard_devices(void) { r8a7790_clock_init(); @@ -220,6 +243,15 @@ static void __init lager_add_standard_devices(void) ðer_pdata, sizeof(ether_pdata)); lager_add_du_device(); + + r8a7790_add_i2c_device(0, &i2c_pdata); + r8a7790_add_i2c_device(1, &i2c_pdata); + r8a7790_add_i2c_device(2, &i2c_pdata); + r8a7790_add_i2c_device(3, &i2c_pdata); + + /* I2C channels 0 and 3 are wired to external connectors; channel 1 + has only one device (da9063) for which no driver exists. */ + i2c_register_board_info(2, i2c2_devices, ARRAY_SIZE(i2c2_devices)); } static const char * const lager_boards_compat_dt[] __initconst = {