Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754588AbdDKJ1l (ORCPT ); Tue, 11 Apr 2017 05:27:41 -0400 Received: from mail-sn1nam02on0052.outbound.protection.outlook.com ([104.47.36.52]:28000 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754442AbdDKJ1g (ORCPT ); Tue, 11 Apr 2017 05:27:36 -0400 Authentication-Results: spf=pass (sender IP is 137.71.25.57) smtp.mailfrom=analog.com; kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=bestguesspass action=none header.from=analog.com; Reply-To: Subject: Re: [PATCH v4 2/2] i2c: mux: ltc4306: LTC4306 and LTC4305 I2C multiplexer/switch References: <1491397671-14675-1-git-send-email-michael.hennerich@analog.com> <1491397671-14675-2-git-send-email-michael.hennerich@analog.com> <376f970f-9e0f-1d44-3813-93691c849b83@analog.com> <67c557ae-f094-9fe4-d2f3-d7a2af2df9ca@axentia.se> To: Peter Rosin , , , , CC: , , , From: Michael Hennerich Organization: Analog Devices Inc. Message-ID: Date: Tue, 11 Apr 2017 11:29:03 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <67c557ae-f094-9fe4-d2f3-d7a2af2df9ca@axentia.se> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:137.71.25.57;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(39450400003)(39850400002)(39400400002)(39410400002)(39840400002)(2980300002)(438002)(24454002)(377424004)(189002)(199003)(106466001)(189998001)(43066003)(93886004)(38730400002)(31686004)(5660300001)(33646002)(23746002)(3450700001)(356003)(2870700001)(50466002)(83506001)(53546009)(36756003)(2906002)(2950100002)(7636002)(6666003)(305945005)(50986999)(54906002)(54356999)(6306002)(77096006)(4326008)(76176999)(4001350100001)(47776003)(229853002)(31696002)(8936002)(65956001)(6246003)(86362001)(8676002);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR03MB2202;H:nwd2mta2.analog.com;FPR:;SPF:Pass;MLV:sfv;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BN1AFFO11FD010;1:TitBD88GnOoC7KdcMQl9Vzc/hpcULPJkTjy7wjGA1p2XBFVThlUyUlFMD8viC6NQGir3YDJPDVehk87LvMK5vAjYVQCz4HSQ7f+TMXzKOM1RWEkJ1656eyLCZ6jRJzo09t+sx0BXYyt1w7dGgBbE7+QZrwOEhVpF/bfD+iNJsZ/W/PyHmEiDXFL0onNyxF8wjiGCR4eS/oKFQrUORxPKpfXsrZLgmF+/hSzXlvU5RpnQ99zwtRjqHic0sgRSo5hKomDwlp6AKDx46VKIH08+dOu5LSgsn0d/p40ZUTVgQjprcXw0ogkCwjnWcZc9CRJQCbIjLuSqrpiDNbdmtuOun6in9DXmVdRIvDczMfNAku2AUp3kazZko8nIITZbuc2SgZCjZaOTUMKTKO6poNdSyPYZZGCuDTVDQYeHriSqdUZ4hq+bW83dBPyyOwgCOaR82m5dWVsqYWg9pVckvcVXPOZ4Tqqq8KpVOBBl9qRwzoLiVb9qvR7Vbzd1hdRbBIKzwr6v5d7WH+nLm9qHnUa381fgNMM23Dg4y/nK3+Jg7pkPLB99yVoAq0HRERHH25d6IUCa965eB34l1Ou98syYwYS1x8K29P7EFe+N1kLRJ5qdUBuxbmsLW754XizxRaJT X-MS-Office365-Filtering-Correlation-Id: 5c2e2a10-b864-4e2a-c68c-08d480bcfc5e X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081)(201702281549075);SRVR:CY1PR03MB2202; X-Microsoft-Exchange-Diagnostics: 1;CY1PR03MB2202;3:8TbjPQHCjIEdrTV8fRmH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KHO351a+Ts+o1JD9pesdUhtgogegwi8xs7wvLfzM2/Eq19p5gdPrGYuk3Z70uNcCaLN2icmhfz8sOkRBYrc08I4KBB2nDOIq5nFjNV9KLfjEiBs0V0AA0JSG/pg2eumMnVg2tZQutkef63Z0F2HVr5mhQFRmtQoSyhkaMZzjtTtcI55YU1t5evOe8Mkc7KXhYmqqxzXXEi9Zi2nPR9pxFTF+2KB59UUPD8wOFT2JYSaCSNI5C3ahhzIWyisjenx7K6Qg0iM= X-Microsoft-Exchange-Diagnostics: 1;CY1PR03MB2202;20:rqhaaVZNWWp6aMwmf7/ulLtpvR5XRKSP6nzfMcVVT4sGPP8W/0WJIsKEExFoR1cYP15mAtWhOkgXRQOaIPjZLAO9FHDa7SQ3fcmiOVPpQCb6dFkVFZ4sJeuiyjjvLHXh5pjgUdsNLy7PVtLHfYwQpMHNTw8Tzr8sB4lOlRgq6Qj5GwcYlLIBHpET5eK8XqAoNvm2rOFiELMKoknEHQ/+sSqGrv7hqZcOTDsjK81DvHjp6fCzUSSaKAAUhZInzyNljg/2Iyq2fjV2DTT0ipJdPdAPkOwyO+rAV65lSSDG7wromfKNzuJ+svXFj30kYWxKjhCJsGljWs0zmspPwmTqAxNtqM9eAvaqGjwNBbrDV0IIC1XXYStshS9/OCTHljrFbm2N1mF2bZnKXs6H2lIw/HtiMvko9WixygQv71tDyqAl7xC8a/4XAvtr9svQy6mqOl6nhhAIR+ZHB0I9uTfu8/u6AiwjubO9QLtpD/1QAOaEOg7tlSLOLHoBJELcZLo/ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040450)(601004)(2401047)(13017025)(13024025)(13023025)(13018025)(13015025)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93004095)(6055026)(6041248)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(20161123562025)(20161123555025)(20161123564025)(6072148);SRVR:CY1PR03MB2202;BCL:0;P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xixDb41hA27SMrKlems11we05EYQ?= =?Windows-1252?Q?VfxiV3OG+YztbtwvdGDXX+nXuJR2HqfTsoUex3kb9Hr6KAUkK0LI/xE5?= =?Windows-1252?Q?P7yCy2MlTBH/ror3i19LmN6vyWsKCcOGaQaaD//2E+3u3YkspFB0ADDV?= =?Windows-1252?Q?xrGAQ0eMejHlrGrudCfJ8Etsf8dhmfccu5pADTxYfFnO9QXvaki7x+tQ?= =?Windows-1252?Q?/b/H8/Z2G8gj4uCPBAJ29bmKr0csCAjGULeQSoZ1GElU3ydrmrNsudJp?= =?Windows-1252?Q?0oKMOIftXSzW9+enlaCKV2ar6h6J4SrjN9sFlhxgaeP1JS0fLQFBR7+Y?= =?Windows-1252?Q?Z3iI6f4DE1gdPH5xitasONCsUHB7rgcFIUr8qAqAr8rFMzegNdauGC5w?= =?Windows-1252?Q?decbNrm/Sr9UuNacNZNvXRT+R7OzaM6pqrYjeNl8dSCOXmCIVtni8wph?= =?Windows-1252?Q?vuRCdTGzOJ8DkxA2zWnDScwxe0fQ+mR1HQ1k6YrBLdp2jBPP9W8Zolfn?= =?Windows-1252?Q?DRuNGjK362q8CEQon+6s/Qa0w50ubz02a8au0ZXb2OHrUBCrJaP+5Eq2?= =?Windows-1252?Q?EYIUB0LTyktqwyefZUcbViesukVnWcY1xShoRVq9W8K+bSYWHFP3a0n7?= =?Windows-1252?Q?YdGcKbeqPp+q0jYGv8JjRRNKkO1f17uqall6l4fEP49B+ZLUfDpLCPHi?= =?Windows-1252?Q?eG4nE//WRH1ufa0uOPfvMhgPVkdGWG2EeAKsUkLXD6xPStxiiEq/BG10?= =?Windows-1252?Q?o1z9gKUM1YhMTW7/bc8LEY1pUClLVBbHj5pEkq30uNNz0ci8TG9erxvD?= =?Windows-1252?Q?c8bfm7Ts8QWgxWN7m9IJxjNjheiqI+cEpMdbZpHmAiIZ3OQFMiQCqw6j?= =?Windows-1252?Q?LyL4xUjYsBP+jO/9/zKC6WHSLY6LHdUhY92BZOBj/4/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AZcB6pZZnNPnq/eVVHX/MH95ZpmzyDiiDeZzhR2q3vnuSrMunEN1FR1JqSkADaTd8Xharxiqh8KKaQeK5YrOF+IyI8D7yiG3lAKdzg8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY1PR03MB2202;7:uUZ9h6Qu/lxyHqMHNIyh1FYalZgSw95EB7ukqoXmv0S/CLamnMDZ8OgrKOL6BDwBzL9Z+GgX6CyTPeeXSsNIiP8QpIDNfKqe/R5laajDQZl8hxTWLkPrZLPJD6micyI/g2SS8Ruw5130/X/9tFX0996dfnQ3wMuRqRYH91TB9WlDSTpMjTDoyTnTgwt9yiWGTbZDhVsZALclHamRlwJyV68vg2Q1AoqJnOaAOXZC6DBuNyrmGd9PXIMQhhQsymLarvsrnBA+wwiJteZ2NTIgrZGJZUm3Qmj5re359dmdNojwC6kbxbShTwfCtI/ImL8h7d+WKYRT0YJju17u0zbq4A== X-OriginatorOrg: analog.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2017 09:27:34.1111 (UTC) X-MS-Exchange-CrossTenant-Id: eaa689b4-8f87-40e0-9c6f-7228de4d754a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=eaa689b4-8f87-40e0-9c6f-7228de4d754a;Ip=[137.71.25.57];Helo=[nwd2mta2.analog.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR03MB2202 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2179 Lines: 73 On 06.04.2017 22:03, Peter Rosin wrote: > On 2017-04-06 13:31, Michael Hennerich wrote: >> On 06.04.2017 10:39, Peter Rosin wrote: Hi Peter, again - thanks for your review. Comments below. >>>> +static const struct regmap_config ltc4306_regmap_config = { >>>> + .reg_bits = 8, >>>> + .val_bits = 8, >>>> + .max_register = LTC_REG_SWITCH, >>>> + .volatile_reg = ltc4306_is_volatile_reg, >>>> + .cache_type = REGCACHE_RBTREE, >>> >>> Did you consider REGCACHE_FLAT? There are very few registers and no hole >>> in the map, and maintaining a tree seems like total overkill. >> >> There is no reason to use REGCACHE_FLAT, in our case it will be a single >> node. > > Ok, so that makes me wonder what need REGCACHE_FLAT satisfies? To me, > a flat regmap seems like a perfect fit here. Oh well... https://lkml.org/lkml/2012/12/19/172 It's not worth arguing - if you prefer FLAT - then it's FLAT While it's still round :-) >>>> +static int ltc4306_gpio_init(struct ltc4306 *data) >>>> +{ >>>> + struct device *dev = regmap_get_device(data->regmap); >>>> + >>>> + if (!data->chip->num_gpios) >>>> + return 0; >>>> + >>>> + data->gpiochip.label = dev_name(dev); >>>> + data->gpiochip.base = -1; >>>> + data->gpiochip.ngpio = data->chip->num_gpios; >>>> + data->gpiochip.parent = dev; >>>> + data->gpiochip.can_sleep = true; >>>> + data->gpiochip.direction_input = ltc4306_gpio_direction_input; >>>> + data->gpiochip.direction_output = ltc4306_gpio_direction_output; >>> >>> I'm missing a get_direction op? >> >> No - its purely optional - the vast majority of gpiochips don't >> implement it. >> >> linux/drivers/gpio$ grep -lr --include \*.c get_direction | wc >> 36 36 523 >> linux/drivers/gpio$ grep -Lr --include \*.c get_direction | wc >> 101 101 1461 > > Ok, but while optional, why not provide it? The implementation would > be about as simple as ltc4306_gpio_get, no? ok - convinced me. I'll send version 5 shortly. -- Greetings, Michael -- Analog Devices GmbH Otl-Aicher Strasse 60-64 80807 M?nchen Sitz der Gesellschaft M?nchen, Registergericht M?nchen HRB 40368, Gesch?ftsf?hrer: Peter Kolberg, Ali Raza Husain, Eileen Wynne