From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05800C433DF for ; Tue, 9 Jun 2020 18:41:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D8D7920737 for ; Tue, 9 Jun 2020 18:41:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="bT+muX/Z" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729926AbgFISlt (ORCPT ); Tue, 9 Jun 2020 14:41:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726546AbgFISls (ORCPT ); Tue, 9 Jun 2020 14:41:48 -0400 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E1BEC05BD1E for ; Tue, 9 Jun 2020 11:41:46 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id x13so22478846wrv.4 for ; Tue, 09 Jun 2020 11:41:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=nmaejAPqL7w5RZ3rYBTgKoizKjTpzF9/rXO7+RKEnFs=; b=bT+muX/ZHRyFVoKnvmGjZYEBoJBSQhFE7M258fsMuSAMDYowHgy3BXIG/jHiBLN3Eu j44yKp2S1Qr5XCQKMWibyk0jNOe5ZUqG43z0mTcQgB8TqqYUAilZ/+TflAKsIoD+DYg1 GiUnrBLUYvuXERBXq188+PcxnG+tGm3IfxkW3Wq0xTDoNESuL/TXFOE+ZgasGd5La3cx 0RN999iXgJC2v/eadBv1wABQnyJuHz70FaHCXXpaWaEftcJLu5dCN01Qk2HOHHG4dywz Noa2fAHca/bEcEoRRIgF3kdGyr3gXsT44NPGuPONy9VKwePCyay2oPzNkfZ81KyeTGx+ F5zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=nmaejAPqL7w5RZ3rYBTgKoizKjTpzF9/rXO7+RKEnFs=; b=lz4sgFCEW8/i6sCG6MV6z7Htjg58FfujnBF5hRAx2ekTmJeGNbK089nvXnGwJwlymo ngeqzhg+4Y4rK2U6ldpkXe0LGkKTJYIj/G8e+c1cQ15hyTlMCbZ7I1nNy9tfWmfkas2c 3MlTttq6ij7sSQlYYkAL8ATODpczb8M4rZMMF2Y7Z3BBc26DqgcSv5uf3iA2dfB/enjD MgQn7kdHy/vv9EgfNa6Q+9xx5iNOInUAOB+fX99hkXdqlKY+sZ5MzLJbVd0M9p/s3rrb Co4jWbwOd53tayYRFmwzPxC/x+UnkiZ1PYOfdmtYKQp/6fDwrR0IGgNiGbIdkW3vSW1l nxwA== X-Gm-Message-State: AOAM531XesY9un97U4fKDdu14ru4e85P81Mja7u9xh7ueitCQg2usNjh yiRhPetCIumbREEb6QQ14qE1Mg== X-Google-Smtp-Source: ABdhPJx5FO/vEubUSX2PK6P+KpZvhjPdNngyh29RNODEGr7a4h7Gn46X2+6wYsXyxNUmt6ZTCXwdvQ== X-Received: by 2002:adf:f44b:: with SMTP id f11mr5884154wrp.165.1591728105471; Tue, 09 Jun 2020 11:41:45 -0700 (PDT) Received: from dell ([2.27.167.101]) by smtp.gmail.com with ESMTPSA id 40sm4694407wrc.15.2020.06.09.11.41.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2020 11:41:44 -0700 (PDT) Date: Tue, 9 Jun 2020 19:41:42 +0100 From: Lee Jones To: Rob Herring Cc: Michael Walle , Mark Brown , Andy Shevchenko , Ranjani Sridharan , david.m.ertman@intel.com, shiraz.saleem@intel.com, "open list:GPIO SUBSYSTEM" , devicetree , Linux Kernel Mailing List , linux-hwmon@vger.kernel.org, linux-pwm@vger.kernel.org, linux-watchdog@vger.kernel.org, linux-arm Mailing List , Linus Walleij , Bartosz Golaszewski , Jean Delvare , Guenter Roeck , Thierry Reding , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Wim Van Sebroeck , Shawn Guo , Li Yang , Thomas Gleixner , Jason Cooper , Marc Zyngier , Greg Kroah-Hartman , Andy Shevchenko Subject: Re: [PATCH v4 02/11] mfd: Add support for Kontron sl28cpld management controller Message-ID: <20200609184142.GN4106@dell> References: <20200608082827.GB3567@dell> <7d7feb374cbf5a587dc1ce65fc3ad672@walle.cc> <20200608185651.GD4106@dell> <32231f26f7028d62aeda8fdb3364faf1@walle.cc> <20200609064735.GH4106@dell> <32287ac0488f7cbd5a7d1259c284e554@walle.cc> <20200609144201.GK4583@sirena.org.uk> <20200609171520.GC1019634@bogus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200609171520.GC1019634@bogus> Sender: linux-watchdog-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org On Tue, 09 Jun 2020, Rob Herring wrote: > On Tue, Jun 09, 2020 at 05:01:17PM +0200, Michael Walle wrote: > > Am 2020-06-09 16:42, schrieb Mark Brown: > > > On Tue, Jun 09, 2020 at 04:38:31PM +0200, Michael Walle wrote: > > > > > > > mfd-device@10 { > > > > compatible = "simple-regmap", "simple-mfd"; > > > > reg = <10>; > > > > regmap,reg-bits = <8>; > > > > regmap,val-bits = <8>; > > > > sub-device@0 { > > > > compatible = "vendor,sub-device0"; > > > > reg = <0>; > > > > }; > > > > > > A DT binding like this is not a good idea, encoding the details of the > > > register map into the DT binding makes it an ABI which is begging for > > > trouble. I'd also suggest that any device using a generic driver like > > > this should have a specific compatible string for the device so we can > > > go back and add quirks later if we need them. > > > > Like in the spidev case, yes. But OTOH if I _just_ encode the parameters > > for the regmap a MFD, Lee don't agree because its just a shim. So either > > way I seem to be stuck here. > > > > Where should I put the code to create an i2c driver, init a regmap and > > populate its childen? > > Find another driver doing this already and rename it 'simple-mfd' (no > relation to the DT binding) and add your compatible string to it. > 'Generic' or 'simple' drivers don't require generic/simple DT bindings. Creating a generic driver is one of the options spinning around in my head. If nothing better comes of these discussions, I'll turn my hand to it soon. > Or extend the existing syscon driver to look up the bus_type and create > the regmap based on the bus type? -- Lee Jones [李琼斯] Senior Technical Lead - Developer Services Linaro.org │ Open source software for Arm SoCs Follow Linaro: Facebook | Twitter | Blog