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 C2F36C433DF for ; Sun, 14 Jun 2020 10:27:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9FA82204EA for ; Sun, 14 Jun 2020 10:27:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=walle.cc header.i=@walle.cc header.b="BlnySnM1" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726966AbgFNK0p (ORCPT ); Sun, 14 Jun 2020 06:26:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725265AbgFNK0l (ORCPT ); Sun, 14 Jun 2020 06:26:41 -0400 Received: from ssl.serverraum.org (ssl.serverraum.org [IPv6:2a01:4f8:151:8464::1:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76259C05BD43; Sun, 14 Jun 2020 03:26:41 -0700 (PDT) Received: from ssl.serverraum.org (web.serverraum.org [172.16.0.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 0729722F99; Sun, 14 Jun 2020 12:26:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1592130396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gJxvGjLG+zCr4pQZGoAns/cjbZC5rD9SgUiVfLcsZLU=; b=BlnySnM1M9f1ZLAY/nIMAW9bAmVM+K1Bf0A3llGF/CTB6QOnLrIBj40JijOMu1qlQSjljA ZtMT+RwKwVKn+uGRrfs5xtJu6Q8SxuYPJCt9FvQTRBheTbAujw+6glWcKcLZOU7A3BmMWG pvRuQ/8ZNiI21iavo62b6Q0nAC/+PSc= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 14 Jun 2020 12:26:30 +0200 From: Michael Walle To: Rob Herring Cc: Lee Jones , Andy Shevchenko , Mark Brown , devicetree , Linux Kernel Mailing List , linux-arm Mailing List , Linus Walleij , Guenter Roeck , Andy Shevchenko , Robin Murphy , GregKroah-Hartman Subject: Re: [RFC] MFD's relationship with Device Tree (OF) In-Reply-To: References: <20200609110136.GJ4106@dell> User-Agent: Roundcube Webmail/1.4.5 Message-ID: <0709f20bc61afb6656bc57312eb69f56@walle.cc> X-Sender: michael@walle.cc Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rob, Am 2020-06-10 00:03, schrieb Rob Herring: [..] > Yes, we should use 'reg' whenever possible. If we don't have 'reg', > then you shouldn't have a unit-address either and you can simply match > on the node name (standard DT driver matching is with compatible, > device_type, and node name (w/o unit-address)). We've generally been > doing 'classname-N' when there's no 'reg' to do 'classname@N'. > Matching on 'classname-N' would work with node name matching as only > unit-addresses are stripped. This still keeps me thinking. Shouldn't we allow the (MFD!) device driver creator to choose between "classname@N" and "classname-N". In most cases N might not be made up, but it is arbitrarily chosen; for example you've chosen the bank for the ab8500 reg. It is not a defined entity, like an I2C address if your parent is an I2C bus, or a SPI chip select, or the memory address in case of MMIO. Instead the device driver creator just chooses some "random" property from the datasheet; another device creator might have chosen another property. Wouldn't it make more sense, to just say this MFD provides N pwm devices and the subnodes are matching based on pwm-{0,1..N-1}? That would also be the logical consequence of the current MFD sub device to OF node matching code, which just supports N=1. -michael 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=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,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 BF4D6C433DF for ; Sun, 14 Jun 2020 10:27:19 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 91701204EA for ; Sun, 14 Jun 2020 10:27:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="UhkgatxM"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=walle.cc header.i=@walle.cc header.b="BlnySnM1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 91701204EA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=walle.cc Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-ID:References:In-Reply-To:Subject:To:From: Date:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=YMRq+dXbHA2OFE+SbV0LwTwrBVTbqIfdUhq20D38Ut4=; b=UhkgatxMDl7aO1L6e7vJfdmMY auBTyKyFEfI/92z/eNZlxIn9CEaoXBsD6eIofkebSpggs8i9eEZMFfnl4lal8nas/pyn00usofYhu VVzhAAydJwM+oaB+VR1OJD2vSqFZW2y/JT7SW10X1kd3QwBhXfC+nugoo61zrOw+hZvfSbcUPNlqj WpebGnUuoq4Nov7LHAAAvwOqBxLgcXU0/0aooKZoaK5mAkz7Tyz4LIwd0dGudW7pn7HS5O2Xxi3CI kUeYhoMyNlf35OCGQ2xTSX546euVwExSnegcE//YXzMGllrethPiJRvBO+eeYA26iES7ie5QQhCZ9 sGNAf5YBQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jkPqo-00018B-OQ; Sun, 14 Jun 2020 10:26:54 +0000 Received: from ssl.serverraum.org ([2a01:4f8:151:8464::1:2]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jkPqj-000176-Dh for linux-arm-kernel@lists.infradead.org; Sun, 14 Jun 2020 10:26:51 +0000 Received: from ssl.serverraum.org (web.serverraum.org [172.16.0.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 0729722F99; Sun, 14 Jun 2020 12:26:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1592130396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gJxvGjLG+zCr4pQZGoAns/cjbZC5rD9SgUiVfLcsZLU=; b=BlnySnM1M9f1ZLAY/nIMAW9bAmVM+K1Bf0A3llGF/CTB6QOnLrIBj40JijOMu1qlQSjljA ZtMT+RwKwVKn+uGRrfs5xtJu6Q8SxuYPJCt9FvQTRBheTbAujw+6glWcKcLZOU7A3BmMWG pvRuQ/8ZNiI21iavo62b6Q0nAC/+PSc= MIME-Version: 1.0 Date: Sun, 14 Jun 2020 12:26:30 +0200 From: Michael Walle To: Rob Herring Subject: Re: [RFC] MFD's relationship with Device Tree (OF) In-Reply-To: References: <20200609110136.GJ4106@dell> User-Agent: Roundcube Webmail/1.4.5 Message-ID: <0709f20bc61afb6656bc57312eb69f56@walle.cc> X-Sender: michael@walle.cc X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200614_032649_776182_C66B5742 X-CRM114-Status: GOOD ( 10.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree , Robin Murphy , Linus Walleij , Linux Kernel Mailing List , Andy Shevchenko , Mark Brown , Guenter Roeck , GregKroah-Hartman , Andy Shevchenko , Lee Jones , linux-arm Mailing List Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Rob, Am 2020-06-10 00:03, schrieb Rob Herring: [..] > Yes, we should use 'reg' whenever possible. If we don't have 'reg', > then you shouldn't have a unit-address either and you can simply match > on the node name (standard DT driver matching is with compatible, > device_type, and node name (w/o unit-address)). We've generally been > doing 'classname-N' when there's no 'reg' to do 'classname@N'. > Matching on 'classname-N' would work with node name matching as only > unit-addresses are stripped. This still keeps me thinking. Shouldn't we allow the (MFD!) device driver creator to choose between "classname@N" and "classname-N". In most cases N might not be made up, but it is arbitrarily chosen; for example you've chosen the bank for the ab8500 reg. It is not a defined entity, like an I2C address if your parent is an I2C bus, or a SPI chip select, or the memory address in case of MMIO. Instead the device driver creator just chooses some "random" property from the datasheet; another device creator might have chosen another property. Wouldn't it make more sense, to just say this MFD provides N pwm devices and the subnodes are matching based on pwm-{0,1..N-1}? That would also be the logical consequence of the current MFD sub device to OF node matching code, which just supports N=1. -michael _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel