From patchwork Fri May 31 09:18:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 17318 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f197.google.com (mail-vc0-f197.google.com [209.85.220.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DC9C725CAB for ; Fri, 31 May 2013 09:20:15 +0000 (UTC) Received: by mail-vc0-f197.google.com with SMTP id ha11sf446850vcb.4 for ; Fri, 31 May 2013 02:20:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-beenthere:x-forwarded-to:x-forwarded-for:delivered-to:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :mime-version:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type; bh=MiseP8sRfsV1z1/pBR6nZpfgOq0FvA6Vycd1La1nJAI=; b=mPnvam3iOnujenJ5lu/yG1aDE066HFVO8XWIyU4jbixms08iLyB9hYAWlxWENtIKOQ HdeucG43KP5r9F+Acj8T+gEg0Hcu4HSsRwEwImWmoagnfjOXPfM5kXxYjaBJEZnLg9O3 MvpJ/7lKcLlaxvPgchcDcEWU1Ez/W5lLLp9oCUHs0d6AvMte11nqG0WZqgCmSXeU+P8A u5e7gD1uIdA1psZrYyKVeIaAonBAgCiZUdr16fStSnVwIAdSevWRCLFAsJJ6gP/j4c3e FrvJqNDQj548cC/PpF9BRteaRNO+idC/Scspda17DA/hPa86AgaQab0zd4ERhZNxD9B7 9Ypw== X-Received: by 10.224.59.205 with SMTP id m13mr6285727qah.7.1369992015275; Fri, 31 May 2013 02:20:15 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.120.193 with SMTP id le1ls847686qeb.66.gmail; Fri, 31 May 2013 02:20:15 -0700 (PDT) X-Received: by 10.58.96.72 with SMTP id dq8mr9174107veb.49.1369992015108; Fri, 31 May 2013 02:20:15 -0700 (PDT) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id sc6si27831394vdc.21.2013.05.31.02.20.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 May 2013 02:20:15 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.178; Received: by mail-vc0-f178.google.com with SMTP id id13so893269vcb.9 for ; Fri, 31 May 2013 02:20:15 -0700 (PDT) X-Received: by 10.52.69.200 with SMTP id g8mr7916389vdu.4.1369992014983; Fri, 31 May 2013 02:20:14 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.229.199 with SMTP id jj7csp42379vcb; Fri, 31 May 2013 02:20:14 -0700 (PDT) X-Received: by 10.14.206.136 with SMTP id l8mr12924777eeo.26.1369992014045; Fri, 31 May 2013 02:20:14 -0700 (PDT) Received: from eu1sys200aog114.obsmtp.com (eu1sys200aog114.obsmtp.com [207.126.144.137]) by mx.google.com with SMTP id 7si30092552eeb.25.2013.05.31.02.19.50 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 31 May 2013 02:20:14 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.137 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.137; Received: from beta.dmz-us.st.com ([167.4.1.35]) (using TLSv1) by eu1sys200aob114.postini.com ([207.126.147.11]) with SMTP ID DSNKUahrNplP3X8oqs52QahSwhbPEBUHkKdI@postini.com; Fri, 31 May 2013 09:20:13 UTC Received: from zeta.dmz-us.st.com (ns4.st.com [167.4.16.71]) by beta.dmz-us.st.com (STMicroelectronics) with ESMTP id 7821B55; Fri, 31 May 2013 09:18:48 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-us.st.com (STMicroelectronics) with ESMTP id B16585C; Fri, 31 May 2013 09:19:48 +0000 (GMT) Received: from exdcvycastm003.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm003", Issuer "exdcvycastm003" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id 0A6C424C2AB; Fri, 31 May 2013 11:19:43 +0200 (CEST) Received: from steludxu4075.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.1) with Microsoft SMTP Server (TLS) id 8.3.279.5; Fri, 31 May 2013 11:19:47 +0200 From: Linus Walleij To: Cc: Arnd Bergmann , Linus Walleij Subject: [PATCH 06/39] i2c: stu300: device tree support Date: Fri, 31 May 2013 11:18:41 +0200 Message-ID: <1369991954-17406-7-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.11.3 In-Reply-To: <1369991954-17406-1-git-send-email-linus.walleij@stericsson.com> References: <1369991954-17406-1-git-send-email-linus.walleij@stericsson.com> MIME-Version: 1.0 X-Gm-Message-State: ALoCoQnka04b0U4bZfKDpyJPLk/LSE20N/4JaLAbyunUOm87y57Y1fejAo44rBsVkZWJ/fMKRO9X X-Original-Sender: linus.walleij@stericsson.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Linus Walleij This adds device tree support for the ST DDC I2C driver known as "stu300" in the kernel tree. Reviewed-by: Wolfram Sang Signed-off-by: Linus Walleij --- Documentation/devicetree/bindings/i2c/i2c-st-ddci2c.txt | 15 +++++++++++++++ drivers/i2c/busses/i2c-stu300.c | 12 ++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 Documentation/devicetree/bindings/i2c/i2c-st-ddci2c.txt diff --git a/Documentation/devicetree/bindings/i2c/i2c-st-ddci2c.txt b/Documentation/devicetree/bindings/i2c/i2c-st-ddci2c.txt new file mode 100644 index 0000000..bd81a48 --- /dev/null +++ b/Documentation/devicetree/bindings/i2c/i2c-st-ddci2c.txt @@ -0,0 +1,15 @@ +ST Microelectronics DDC I2C + +Required properties : +- compatible : Must be "st,ddci2c" +- reg: physical base address of the controller and length of memory mapped + region. +- interrupts: interrupt number to the cpu. +- #address-cells = <1>; +- #size-cells = <0>; + +Optional properties: +- Child nodes conforming to i2c bus binding + +Examples : + diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c index 0a6f941..1beaa05a 100644 --- a/drivers/i2c/busses/i2c-stu300.c +++ b/drivers/i2c/busses/i2c-stu300.c @@ -17,6 +17,7 @@ #include #include #include +#include /* the name of this kernel module */ #define NAME "stu300" @@ -923,6 +924,7 @@ stu300_probe(struct platform_device *pdev) adap->nr = bus_nr; adap->algo = &stu300_algo; adap->dev.parent = &pdev->dev; + adap->dev.of_node = pdev->dev.of_node; i2c_set_adapdata(adap, dev); /* i2c device drivers may be active on return from add_adapter() */ @@ -934,6 +936,10 @@ stu300_probe(struct platform_device *pdev) } platform_set_drvdata(pdev, dev); + dev_info(&pdev->dev, "ST DDC I2C @ %p, irq %d\n", + dev->virtbase, dev->irq); + of_i2c_register_devices(adap); + return 0; } @@ -978,11 +984,17 @@ stu300_remove(struct platform_device *pdev) return 0; } +static const struct of_device_id stu300_dt_match[] = { + { .compatible = "st,ddci2c" }, + {}, +}; + static struct platform_driver stu300_i2c_driver = { .driver = { .name = NAME, .owner = THIS_MODULE, .pm = STU300_I2C_PM, + .of_match_table = stu300_dt_match, }, .remove = __exit_p(stu300_remove),