Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752409AbcD0Ijg (ORCPT ); Wed, 27 Apr 2016 04:39:36 -0400 Received: from mail-db3on0119.outbound.protection.outlook.com ([157.55.234.119]:8992 "EHLO emea01-db3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750721AbcD0Ijb (ORCPT ); Wed, 27 Apr 2016 04:39:31 -0400 Authentication-Results: codeaurora.org; dkim=none (message not signed) header.d=none;codeaurora.org; dmarc=none action=none header.from=axentia.se; Subject: Re: [PATCH] iio: inv_mpu6050: Add support for auxiliary I2C master To: Jonathan Cameron , Crestez Dan Leonard , References: <5b1937140558514b3e43ed2c21ee860ecbac61ec.1461172603.git.leonard.crestez@intel.com> CC: , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Daniel Baluta , , Wolfram Sang , , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala From: Peter Rosin Message-ID: <6ab228db-9695-ac22-9c65-fd15c4837c45@axentia.se> Date: Wed, 27 Apr 2016 10:39:17 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [217.210.101.82] X-ClientProxiedBy: AM3PR02CA0067.eurprd02.prod.outlook.com (10.163.180.35) To VI1PR02MB1311.eurprd02.prod.outlook.com (10.165.231.153) X-MS-Office365-Filtering-Correlation-Id: 0fb0aa7b-d0a7-44aa-243d-08d36e7770d1 X-Microsoft-Exchange-Diagnostics: 1;VI1PR02MB1311;2:TP891hj3TpBjfRy7jGIgCSWh/RChUlFUEZLqaMYpP4YVfAG726uvgfv7nJpVgYRL+CHBV1Iro53Y/ZWooY2gz4QHhjYZGUuamEafPODfvbI/dFOditR7n1wJiccPVlB+jz4MfUf8VQUwjfWi75dsM6yEg8mjgmtmODOq7G0L+CsLe3KLlE6ot4oEgr2+cYe7;3:wW8qPmvQilGq2AlJII+yN/9NcfgQ7rpIczCPTYAaR4cZVt3zJiBqSG7YvOI4YxQskHVvrXYWJX1twRGMl3kuKp5eadaisuyGMF5gres9/TqDG6hMMwF+DJuANUo/RV0s;25:HicPLx0k8PWSluBZKDIX0NiwG/+5MSzocu3IF49zVL9ktwNeyeOa4+bWfQ/oLlV2BQjGpZKowgG4Uue4P/H8xoJ3IIHdS0zRWypjvI1PXolbkaw+T0BU80kKvvun/sCL3W5NfoYhA/T6CuwmdR8LBcxYOXcEa2cE+3ri6W+4G8kWX/7ri6CIqJMq+dz6o0EHbdcjeMGUNcURWimvTLT/JseO0YQ8c+15RWkbXw8TazBcJDxn2N4f5FmbhTY4B4C6TjgDq18ycBs84LPc+7HIukfZEzK1KHkeDZEIlYKZr/ToND4Vm2NQI1d84c96Gn0OnD2Ba6L/sAeKhycMKhMqTA== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:VI1PR02MB1311; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(9101521072)(6040130)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6041072)(6043046);SRVR:VI1PR02MB1311;BCL:0;PCL:0;RULEID:;SRVR:VI1PR02MB1311; X-Microsoft-Exchange-Diagnostics: 1;VI1PR02MB1311;4:LinnimzFyRwzQ53uyZBdNFi1yzoPiXTF7VUsKwQLEwQav/5SlJB0U6kn1P6hWqFwi7MfLOegDiMVY3VX+xRj+wi9QFWBEBYsoiCil7mjFX2HGLbdI0jIdEYfJyIPEY643vX0YsifGdJ2YmXrMRj41t5En8WLb+hXSq90FlinvNDESKO3SM86oDOkcU6/qnRsWqWcG2I2O9sSeMVk750imSeXoLhMVm7miYruF7n3nE+HnkcooSSVZHIIS4IiZ8gNSubZ6wa2KP/rWiEQR6oWjXPU0tfvhmz0pVQ8Z9hzbd5XTK+ZJJ/qzQpW1Qnz6EvTyAAVDX7KnPwjjVVv49oJ2nHduslEgF+PexchWQ0HYvrjh3Ex5tAu5VPlR3aPv5DNObqgiyG/4AjYENHkmpyl237VipXpFRrMZMkkLsmD9GwoOAdmjlsjbqKqZwMo1V1j X-Forefront-PRVS: 0925081676 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(6049001)(209900001)(24454002)(377424004)(65806001)(4001350100001)(19580395003)(66066001)(19580405001)(33646002)(65956001)(15395725005)(2906002)(189998001)(31696002)(36756003)(5001770100001)(6116002)(31686004)(3846002)(586003)(42186005)(117156001)(230700001)(86362001)(92566002)(81166005)(4326007)(1096002)(23746002)(2950100001)(50986999)(5008740100001)(76176999)(54356999)(64126003)(74482002)(5004730100002)(50466002)(77096005)(47776003)(15975445007)(65826006)(7059030)(42262002)(2101003)(6606295002);DIR:OUT;SFP:1102;SCL:1;SRVR:VI1PR02MB1311;H:[192.168.0.125];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;VI1PR02MB1311;23:yubdaGOYKA1dwW4dZcwnW2YFlkyt4GTuXZo7S?= =?Windows-1252?Q?CVgUKwTlxwdOwZQrL7xotLQKTlqJs3sJW7zQGf/IrNPOcgCeauv1rIkj?= =?Windows-1252?Q?gzAEEw9b5hFHP6kt49/aUdEtCUMucS7FneITyGSNgcFqm7qhva49X6JN?= =?Windows-1252?Q?8hrAI0HqkGYKeLYEeJ7JNLklRDZrVZtdmHG7NPSMVfWrtj5RCnvHT+NJ?= =?Windows-1252?Q?m0SDSM0vtopdXRoPYTTmJVJbuYH1sO6QQ/bclBwXBPPkJqcgqKbZHR8W?= =?Windows-1252?Q?Lwb6yuSCCDhmZaxEk2KiCZBxmx/lWb+w8lgu6VO6jEPrsr9uqXcunlps?= =?Windows-1252?Q?Q8DqAICPWC14QtgizJRfrqcKSO5o8Wxxk4pwQrDzylHcNuxGhoRQktQV?= =?Windows-1252?Q?HrmZt0C4U/m9A29P1mq6U8fFPfw5qfPpUt5OeymnEZudTHVZnf+5xGt7?= =?Windows-1252?Q?kE3juEBPdfOzUKiKxkuAnEqwz0moJH89TkT/gQlYXnb8Y9lTrZh5VDy5?= =?Windows-1252?Q?UZ0AcuJAE3Tdo6PHGSNfos5/nliM9jfpqDZzc19HOLZ9ClxLQn6o6Zsa?= =?Windows-1252?Q?1/2DOs5ssX7gWP3DC41QLeDVLaewDtZKFDcNB5GvgR0R4m1FBsFAlB2n?= =?Windows-1252?Q?Tp87pWd/634HQso9rt8D5+ne8Bnoo7yfrvsElbMroWcZgweK1zPkejXY?= =?Windows-1252?Q?yPJtbMC8mVo+Ncj1B2wHx+gYJ8bz2/lyxMHY2+Aq+INQR6sYKys8I/BG?= =?Windows-1252?Q?0PqRUE9bumYKGa1kjpCpqU4/fXjSJvzhhqRgD30vOkYJu1uK1lXn1+J7?= =?Windows-1252?Q?71Pdzi+bu4wiMk5IOUy9CAASozb33oYH/Ot4Oa2OBH6hSohG2dsZemgD?= =?Windows-1252?Q?mDfMHWN8BiGyMJwyfxyV+pfnmcU/5JahhpqFkTFevjaQU9Zv4qL3A2JN?= =?Windows-1252?Q?8dZOmCh1jLgRj9wTnunTZUNPF+F69zlIgcaZD/KSW80Cp4e9EyfCa7/h?= =?Windows-1252?Q?HYnP/QdylVQSGvzBQaPax+Bz6GLk+fSbbrp4IBD7x/Et1VdFF2nCt2/4?= =?Windows-1252?Q?igQLuzZDjP1uh1sicC/V35vOpbnmvXpeYzNZnspN2RmqZ5S6HsdSC1FK?= =?Windows-1252?Q?sbs+5PzcGOlIX+M/Ld0FWhtn2jvkqiw6lbLAN8jtKt1w8lYPBYdIRRec?= =?Windows-1252?Q?oSMuJwcowChuOPC4Z1J9mQfj27/LErtJZmgKjjDH3U136rfdFN1XK3Oy?= =?Windows-1252?Q?iKbuVPhyR4/cNGaivMy0VrW+v2pkSHV2co+ecEDY69dEtTcBQWu0Vpla?= =?Windows-1252?Q?2gInbMpSPi4lAkSgRLPXdDv4uMhBMIYyS/a4zXsFhnAIfGYO8936rLiB?= =?Windows-1252?Q?NPxrIEgT/ie?= X-Microsoft-Exchange-Diagnostics: 1;VI1PR02MB1311;5:gulm46cwAhxE1OSdMuXSYpEMsuhoyiKvcgJxIRZhfQPgsX/vKclp5ruKfg87vvn5ga2n1jbKjvXYE7CBfpbU2jdIvR33XcbiHiswmYsTMyoslu7vakMvbvvphLbCEM+yQiW38eRggDCl6k8MMQsvDQ==;24:+AewAvC+vwDF+qGs2j9SBFMfZW2oktiXPs800aNS3Z++kBFS8qe+U0oaiEYOMVR+4Y1xrjUsz0dOzmgjCb4UveyKyOA9ro9DZGIb5/glK3M=;7:8mIb6345bX66UxLEWv/j/dMoTuKpxju46dEJzqlGNM/cP7yYLWn0zhZnEuGVCzZRKZ7Uvy24XvJNmF7BGi0UtBFkgFc7x9JlArehOFAgE9DXrDPs3ETKoJ5sjZ1H2uuVxA7q/0VIN0vriuf/ZM7w8wBKn5+AjbRb47c+GoXkVk0dr3EWPt3KagU1JNZNisWJ SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Apr 2016 08:39:24.5883 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR02MB1311 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2264 Lines: 79 Hi! On 2016-04-23 23:32, Jonathan Cameron wrote: > On 20/04/16 18:17, Crestez Dan Leonard wrote: >> The MPU has an auxiliary I2C bus for connecting external >> sensors. This bus has two operating modes: >> * pass-through, which connects the primary and auxiliary busses >> together. This is already supported via an i2c mux. >> * I2C master mode, where the mpu60x0 acts as a master to any external >> connected sensors. This is implemented by this patch. >> >> This I2C master mode also works when the MPU itself is connected via >> SPI. >> >> I2C master supports up to 5 slaves. Slaves 0-3 have a common operating >> mode while slave 4 is different. This patch implements an i2c adapter >> using slave 4 because it has a cleaner interface and it has an >> interrupt that signals when data from slave to master arrived. >> >> Signed-off-by: Crestez Dan Leonard > This one needs acks from: > > Device tree maintainer (odd binding ;) > Peter Rosin (odd binding interacting with the mux support) > Wolfram (it has a whole i2c master driver in here). > > (just thought I'd list these for the avoidance of doubt). I spot some overlap with the questions in "[RFC] i2c: device-tree: Handling child nodes which are not i2c devices" http://marc.info/?l=linux-i2c&m=146073452819116&w=2 And I think I agree with Stephen Warren that an intermediate placeholder node would make sense. I.e. mpu6050@68 { compatible = "..."; reg = <0x68>; ... i2c-aux-mux { i2c@0 { #address-cells = <1>; #size-cells = <0>; reg = <0>; foo@44 { compatible = "bar"; reg = <0x44>; ... } } } } Or mpu6050@68 { compatible = "..."; reg = <0x68>; ... i2c-aux-master { #address-cells = <1>; #size-cells = <0>; gazonk@44 { compatible = "baz"; reg = <0x44>; ... } } } depending on if you want an aux-mux or an aux-master. But I don't know if that intermediate i2c-aux-mux node causes any problems? Cheers, Peter