From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Rosin Subject: Re: [PATCH v2 3/3] power: supply: bq24735-charger: allow chargers to share the ac-detect gpio Date: Wed, 14 Dec 2016 18:41:00 +0100 Message-ID: References: <1481673405-4547-1-git-send-email-peda@axentia.se> <1481673405-4547-4-git-send-email-peda@axentia.se> <20161214165921.jsatcznbljd7anqi@earth> <20161214170114.ckozfple475kqajh@earth> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20161214170114.ckozfple475kqajh@earth> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Sebastian Reichel , Linus Walleij , Alexandre Courbot Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-gpio@vger.kernel.org On 2016-12-14 18:01, Sebastian Reichel wrote: > [of course I forgot to actually add gpio people, let's try again] > > On Wed, Dec 14, 2016 at 05:59:21PM +0100, Sebastian Reichel wrote: >> Hi, >> >> On Wed, Dec 14, 2016 at 12:56:45AM +0100, Peter Rosin wrote: >>> If several parallel bq24735 chargers have their ac-detect gpios wired >>> together (or if only one of the parallel bq24735 chargers have its >>> ac-detect pin wired to a gpio, and the others are assumed to react the >>> same), then all driver instances need to check the same gpio. But the >>> gpio subsystem does not allow sharing gpios, so handle that locally. >> >> Adding GPIO subsystem people to see if they can come up with >> something in the gpiod API for this usecase. Right, I don't like how my new code steps away from gpio descriptors. >>> However, only do this for the polling case, sharing is not supported if >>> the ac detection is handled with interrupts. >> >> Why? I guess you only added the gpio polling stuff for the shared >> gpio feature, so we can skip the gpio polling if we add shared irq >> support instead? Nope, the hw really can't do interrupts on the gpio, it's just not wired up for that. The gpio is on an expander, and the irq line from the expander top the cpu is not there (due to a desire to minimize the number of connections between two parts of the system). So I need both polling and sharing. Cheers, peda -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933304AbcLNURa (ORCPT ); Wed, 14 Dec 2016 15:17:30 -0500 Received: from mail-eopbgr40105.outbound.protection.outlook.com ([40.107.4.105]:47648 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933067AbcLNUR1 (ORCPT ); Wed, 14 Dec 2016 15:17:27 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peda@axentia.se; Subject: Re: [PATCH v2 3/3] power: supply: bq24735-charger: allow chargers to share the ac-detect gpio To: Sebastian Reichel , Linus Walleij , Alexandre Courbot References: <1481673405-4547-1-git-send-email-peda@axentia.se> <1481673405-4547-4-git-send-email-peda@axentia.se> <20161214165921.jsatcznbljd7anqi@earth> <20161214170114.ckozfple475kqajh@earth> Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-gpio@vger.kernel.org From: Peter Rosin Organization: Axentia Technologies AB Message-ID: Date: Wed, 14 Dec 2016 18:41:00 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20161214170114.ckozfple475kqajh@earth> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Originating-IP: [217.210.101.82] X-ClientProxiedBy: AM4PR0101CA0004.eurprd01.prod.exchangelabs.com (10.167.254.14) To VI1PR0201MB2320.eurprd02.prod.outlook.com (10.168.63.22) X-MS-Office365-Filtering-Correlation-Id: d1e02889-eeea-486a-acb7-08d42448626b X-Microsoft-Antispam: U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kQpOZEQlmOHr+bMkrgGZKgWhp8Yn5sFWlNW+M74HS3BE3EypOUz2LgH1hdbSjXdestJY6krpYuFKxMxUqk7NzswBpNlDoyX6aPQKA=;4:zCWj5IbRJLH7n/R10rPg23GSMJaJVfeDErRnNXsIu7Mb0iJDAIVPt5I0wY2Yiv8SfOmqtHHdAF941nYpkJglTUdTljaGWEfxX51Er7+C9zXFKw4S8epNjubO8dPZ/RKN1SNKTcpPXvA9yd+noVv89X3IFV6gLNClJfZ+jl3dV2j4YMjXXOcyLJwv/8KSezBQDDiju+1F2pvb1EF18O15IO5fdbmbGWn6SAYB0qcexOqBVOmsYgw6uQTiZoB72GrThqWtSRD9rea/mIszAWcI+zUPWlYGt9xhNFce/cLEVGUe5E8YRDIe2dLrdF/hk0yszdvnxq2jw2KLdbIFM5UbV5gSorG1tBux/mlyHL82LNa/yh+VmKPzqbR89WG0rp5c3tqvO73tO1j+NEJYnvkMYDKoY/MCR7uATAWCe28gbAN6Id1crVvGpegBMqNr1PlJDTh3Gj/XcKxBSKR+K27FvjA7+US1s3RAs4ppz6pATYe607en444+ShiF0bqeG/HSRWWZA/V6gy8Zen8EByPVZz4pR2cXveAcwj1sF87lha7eUJOx7xj9NoFqVCstOe1R+uib6MkJI/3Pa8CTfIJsyzJtvrVe6rIgQe1253N4Ow61rJpMd1OXcjHZAfuSjfgP X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041248)(20161123564025)(20161123562025)(20161123560025)(2016111802025)(20161123555025)(6043046)(6072148);SRVR:VI1PR0201MB2320;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0201MB2320; X-Forefront-PRVS: 01565FED4C X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6049001)(6009001)(7916002)(39410400002)(39450400003)(39830400002)(199003)(377424004)(24454002)(189002)(50466002)(2950100002)(23746002)(230700001)(74482002)(92566002)(66066001)(4001350100001)(38730400001)(3846002)(6666003)(189998001)(7736002)(97736004)(65826007)(305945005)(117156001)(4001150100001)(39060400001)(5660300001)(83506001)(101416001)(68736007)(81166006)(33646002)(229853002)(6116002)(8676002)(76176999)(50986999)(81156014)(31696002)(105586002)(5001770100001)(54356999)(42186005)(6486002)(93886004)(2906002)(106356001)(65806001)(86362001)(47776003)(65956001)(36756003)(31686004)(64126003)(90366009)(77096006)(25786008)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:VI1PR0201MB2320;H:[192.168.0.125];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;VI1PR0201MB2320;23:0GcG3bDQ1QVuCMe79fvtigcslVoMWGkbFj2?= =?Windows-1252?Q?QGyw/LyXomceuxEkpdHhaY8ZgtGl2hAn6YYRahdpjoNX17OMLOjS2hnF?= =?Windows-1252?Q?OqivLCSKDlRuj1G6U6d62Q86KjtNGaayPtys8DNuiTamrnvZDNMRSxzs?= =?Windows-1252?Q?hhA2PNhLOJ3xPHaubKvKQ2chmejVPWDOS64dvg5eSt9YZ7LPeAoGdyiR?= =?Windows-1252?Q?6EJQxBwg3hpdufEE2KUZkR5y5DhPVbK6VlUYNMU0SmFs14BnYTEYKlR8?= =?Windows-1252?Q?AVjz0mkxAWBxOxmqzYpwQSxxwLQPuyoo19Jc8kvqbbQjwgZLaaSzuuuO?= =?Windows-1252?Q?Uk3VdhIcqnVhPDhwPoc+y6jX0HTI+KG0b7HLicAfD5dvul+PVXKYIYyL?= =?Windows-1252?Q?Wd45m+sxEpX1ABQdFEq7TSLfs0CIobzPEsn/VW3KdDDk5vNtr8BuEa9H?= =?Windows-1252?Q?jDryx/QjaWfkDFo4OIZhV4BRgc710g2rjX46P7XaAvMOhV9e0qipdNif?= =?Windows-1252?Q?mtowqmNsgOjwaMAKttb5EJZOoCVoxfvmt5cKECB6pGgWF6KxUIwO+iVW?= =?Windows-1252?Q?xTc7FsKHI7mwqSojFkD2YKY5307FmcRLQbOx6MwvCJW4EqEPvcSLpt1W?= =?Windows-1252?Q?mlIpNp0RdZKaQl2fRItUUtmIfQr8K8K7Pj3qcth5OT/uwxcZ9/MCUEM4?= =?Windows-1252?Q?VIvPEtGMwsj1w99Mw4D9KmUIKOa8pDRONjgl1ED7cA3Pw/CNwfCnKXpj?= =?Windows-1252?Q?Hr/RoR62PJg/QYNxswGASUF3haG7kHIHsRDECK52qevwXRWOwog6Sdog?= =?Windows-1252?Q?1vgBf/OIRcZVsEFOpmY2EzxjkcmlGiGAqhF7EVKh94P3UMLIFogAVHPS?= =?Windows-1252?Q?3uytX1DHOw0LE6uL6jj57nAmnsbfcZpfL0X60eCpe0irxTJDtgFQ4J9i?= =?Windows-1252?Q?c/DG5+sP8N46ASCOlENX4X8JWCbpd+1d/1d/tTlrSRIp0fIO8wHp86Fr?= =?Windows-1252?Q?6lJCRXaEfFAhCgt9Dhtb9RqeroQG8AFY6ww4vsPPkTkSMGv+u9HFOuL/?= =?Windows-1252?Q?KozZ66SyldK23PjlHascYPIvflKRX7kzI1otMO7kEl1vkX2NBvMfbPE0?= =?Windows-1252?Q?C2Ua4K0Y1sS8Lcv//8PEB2afR3QRQ2VFE8XdOphzwhJrskPq+rM9iz+C?= =?Windows-1252?Q?zcIjIqcirG4fPOFeEkMwGPl2P1+DJ3+o3rLOqiIMYX2U1UIFC/FurnCE?= =?Windows-1252?Q?F/kvmYT5k3M67XFDk+62a2hbmfzC2nnNsXgo5fMBiJ6HzaB2Vidx7KEX?= =?Windows-1252?Q?Iri+dFha5twDfykMbi/dlAiHDg0Ghh+P55PFY5XmP+mAO5CNUhXpodQY?= =?Windows-1252?Q?QAt4ty0JdG2jGgDXOJvh+OnL8Izz4x7ywgKS9DQ4n9Xov6xjsJSmcccT?= =?Windows-1252?Q?XRUljnqIrqhJThVMSQ7TwECNkkGcq/m3YtLPR++/7tBX6t9/yqeml4L5?= =?Windows-1252?Q?e/JRCnMWLcTTGPmU8RNPDXN5KUaoVZFPVK+c4cHQo8P0eHfLdYzPCf8m?= =?Windows-1252?Q?i57FxJFnOHSklbHKQJgmIBFxWttlHMGv9QI7V8ymr+bkSTvRI9oRAydu?= =?Windows-1252?Q?NySe0Ov647DB7Zk62gnvKA0k=3D?= X-Microsoft-Exchange-Diagnostics: 1;VI1PR0201MB2320;6:6LQODmIps7UEm8BB3srP9JtnQA2fOdBwfW55KJUcd52R5dUehVtKDB04J68AohbHYXnAGAR2Bie1bCimDMJdt6gCNCAi2yqdy+2EhYp02VaLCCEwzvQtBW/CFzsynDDZC3iE9UzzIEgjWE2jmVDyYW9MpPF2ciUSe8xhYshDhxiSLgXmDYCQJcsUj/QdyTxN7dj3d6SeQmI7ayIt0dHYuRiwE1A16j6BKIeSvR0CFeLsdR6bDHFIfbUGSlFckHoF53E8Fze5bLgCe9cQ2RZ6sZR+bTYBl6n9ASQNShI2EV2nRtc2cLj52T45fjEaxWNIn7l2gJ4Zf5xsrEd7Flinc2KIxyWfSBjiNhFE5OaNqbH6YGBGaPf/d93pSh2ZjPrzCGyUdWaTLiZ5jilrJdHx5B48TQs+yD5hQRr5tue1JViH13zHy7XT+yf0Ojk7kOcP;5:0zGkRVwZwGeSdUiiWC33DEQ5WwCdWNC66DfEqlk7PEW02g0l6w5tWGQzbYWKb0B6Zqg9aXaW5n46uyFVnPfJWJgck7ldxE8eKslN7L7L1ysjBMe6OdKnQwHTKKn51f6Ou7JorMWVNrA2w2n+ccxbxA==;24:mUuY+A34jg9MKvp+jaEHFaBRyOVo/0CTLa/Va6nIJweVmPTnFOd9EjX8H2bdP76J9z9eKJtp9rIxeiQvjTkt59ZNwgNxxiQ5PwQWQ9MLzWE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;VI1PR0201MB2320;7:TPQBi67WQ6iid355h4AcUbyrBNwGjvjUTubNwVY7/jRo2jcbFQM5r0je9cdZ0GjMnGuw/Ix0iigC4mPMQH5xSiD/RDZadFhvfQry5enogyxyJQBTta9WckOPmGRC9jLwwmLcguwLavE2DTjsRJUHtIHDZjlr8yJagnp5lBlwaznKvb3wA5F9coCkvcRf3ebKSu/DJjSnZj21PQmoXLva8yzp8EKj2XG65wG927qxHErtkkxzxnTbw7CZbYxepjmG05bEJxipbJNX3/zvf+uTPeEJslppUBGekxyqL7v4zV+V9SEbLT3QmkHzG5WVWYwytptPGV5rQW7gwkVM8ABsUZsWwJs+2gQVkC1oY4ZemFpNXJJ3FhSIV2/PPJ2oaqbTN+duGlh1lzmuP+Slt1awqjf7kuTplew3IGJ7rNpy4RTN5oepAjOnKe16NVAe3bEE0zTNiFn3kgzHwjaGEfIpGQ== X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Dec 2016 17:41:06.5885 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0201MB2320 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016-12-14 18:01, Sebastian Reichel wrote: > [of course I forgot to actually add gpio people, let's try again] > > On Wed, Dec 14, 2016 at 05:59:21PM +0100, Sebastian Reichel wrote: >> Hi, >> >> On Wed, Dec 14, 2016 at 12:56:45AM +0100, Peter Rosin wrote: >>> If several parallel bq24735 chargers have their ac-detect gpios wired >>> together (or if only one of the parallel bq24735 chargers have its >>> ac-detect pin wired to a gpio, and the others are assumed to react the >>> same), then all driver instances need to check the same gpio. But the >>> gpio subsystem does not allow sharing gpios, so handle that locally. >> >> Adding GPIO subsystem people to see if they can come up with >> something in the gpiod API for this usecase. Right, I don't like how my new code steps away from gpio descriptors. >>> However, only do this for the polling case, sharing is not supported if >>> the ac detection is handled with interrupts. >> >> Why? I guess you only added the gpio polling stuff for the shared >> gpio feature, so we can skip the gpio polling if we add shared irq >> support instead? Nope, the hw really can't do interrupts on the gpio, it's just not wired up for that. The gpio is on an expander, and the irq line from the expander top the cpu is not there (due to a desire to minimize the number of connections between two parts of the system). So I need both polling and sharing. Cheers, peda