Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5081159imm; Wed, 12 Sep 2018 00:31:44 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYT/YooP2kaYedMEZl4PBYHHt2A5EHdrOsmx4fJmkK9dmuN1VpZFdo5DkcV3qdK8a3/f4ix X-Received: by 2002:a62:25c5:: with SMTP id l188-v6mr646899pfl.179.1536737504777; Wed, 12 Sep 2018 00:31:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536737504; cv=none; d=google.com; s=arc-20160816; b=HhH0Kp6GeWaMsTvmPf7Klxhv6XdhuRPvE2lrQDHfBR5fsVPUbKUZ5kRv8cuAh0U4cu MAgNy1f98X/3kogxdKb5D3OleFMocDSF4pkf92RyC92bzoVbnqlYnB8+tMT8+e78nTkX la/k2hjEz9yzd+EKIyBbB07RiiOJ2Z0REJr8NS9ZYu0VwTwnohCafR6JI0gBpG1Berc+ DmBZ5yxn3E28YGef3k/e9xAiTP07GYBhCFJZaiLpXoYv3Lg7aYYbk9DgTSDXyWobRYVS Hx2PXVbuXNbREjbZ/7dz0RNtjaucsYWcH4H1mpRQ4AgpcyLr3t6RaaWgsJ7Tm1Eqf19j 5B/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=zZeYaLIvuNgdhzYvTB3F2Svvf2RagQK94GSMPf8ouoQ=; b=ZrmwDhOQSOpyOTc7HQDxTKOOgJCB7WUr8wREgM9rvyEGpNuQHJ6QFwsq8ZHYaGu9F9 NMpi+YTuNCY9hHmZ8uozsqYd8m6DxnHxltkAmx9fgKTGmhx1YFzHgooyIPGVr4hv+h8b 62AfYZD8PWl9EzymugMyYlBz9vMnnkAjI6Zi+vJ7IdOPoxAE4SY3UX0ql2Ut5tvC96lO 61iWzoEp0y6qgKsjhy9bkIsNftbCk6pROQZlR5Gzt5WhN6nK3wmMzbnSbGCsIhefH0jF 5p6gSL/QRaPNHxC1do3UkeCiqwAtpHCoNOrYHCJcom3ptdLUqj8qDwv8TrL5QFDjZEdw AG2w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e7-v6si261390pgm.649.2018.09.12.00.31.29; Wed, 12 Sep 2018 00:31:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727640AbeILMeN (ORCPT + 99 others); Wed, 12 Sep 2018 08:34:13 -0400 Received: from mail.bootlin.com ([62.4.15.54]:41799 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726673AbeILMeM (ORCPT ); Wed, 12 Sep 2018 08:34:12 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id B69D720795; Wed, 12 Sep 2018 09:30:57 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (unknown [37.71.171.242]) by mail.bootlin.com (Postfix) with ESMTPSA id 89B7420720; Wed, 12 Sep 2018 09:30:57 +0200 (CEST) Date: Wed, 12 Sep 2018 09:30:56 +0200 From: Alexandre Belloni To: Lee Jones Cc: Geert Uytterhoeven , radu_nicolae.pirea@upb.ro, Rob Herring , Mark Rutland , Nicolas Ferre , Greg KH , Mark Brown , Jiri Slaby , Richard Genoud , "David S. Miller" , Mauro Carvalho Chehab , Andrew Morton , Arnd Bergmann , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux ARM , Linux Kernel Mailing List , "open list:SERIAL DRIVERS" , linux-spi Subject: Re: [PATCH v12 0/6] Driver for at91 usart in spi mode Message-ID: <20180912073056.GA2557@piout.net> References: <20180904111310.4049-1-radu_nicolae.pirea@upb.ro> <20180911093356.GE4185@dell> <20180911093917.GL2494@piout.net> <20180911153621.GP2494@piout.net> <20180911181838.GI4185@dell> <20180911224302.GJ4185@dell> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180911224302.GJ4185@dell> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/09/2018 23:43:02+0100, Lee Jones wrote: > > I haven't read it, but I believe it's not unlike Renesas SCIF, which is > > served by both drivers/tty/serial/sh-sci.c and drivers/spi/spi-sh-sci.c. > > But the latter is not used from DT, so we haven't experienced (and solved) > > the similar issue yet. > > > > Would it work if the UART driver and SPI driver would match against the > > same compatible value, but the UART driver would do in its probe() > > function: > > > > device_property_read_u32(&pdev->dev, "atmel,usart-mode", &opmode); > > if (opmode != AT91_USART_MODE_SERIAL) > > return ENODEV; > > > > while the SPI driver would do: > > > > device_property_read_u32(&pdev->dev, "atmel,usart-mode", &opmode); > > if (opmode != AT91_USART_MODE_SPI) > > return ENODEV; > > > > ? No MFD driver involved. > > I haven't looked at the code in a while, but if memory serves I > believe platform code gives up once it has found its first match, so > by doing this, one of the drivers will never be matched/probed. > > It's midnight here, so cracking out the datasheet isn't going to > happen just now, but it's my current belief that if the IP serves 2 > very different modes of operation, even if the registers are in a > shared space, they could have their own compatible strings in DT. > > That is what the MFD driver provides after all. Why would it be okay > to allocate different compatible strings from the MFD, but not in the > Device Tree? > > It would be the easiest solution. > > Has Rob commented on this yet? > V4 of the bindings were acked by Rob and you: https://patchwork.kernel.org/patch/10428087/ -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com