Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4452132imm; Tue, 11 Sep 2018 12:06:58 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbQZHL5CAnDKMBFWyDKF2a4IzhhweqjfiLPAQ/pHGk5bUAWjbou0cysLcDZej3CMaTuksuW X-Received: by 2002:a63:d645:: with SMTP id d5-v6mr29766419pgj.450.1536692818183; Tue, 11 Sep 2018 12:06:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536692818; cv=none; d=google.com; s=arc-20160816; b=cYekksLVE8MRvSou7mOJowUmiS4k/vTQIhlo93lPNSpy7eMw4oOA0KQuu3yDvtkO/2 ilDHxYujLvRdwESym8w6hOr+dtCfvyE6vcgi6PZg25FYvmsJ9t2sByFyOh35wOBqMqgS 4ffBEmCnFEPPd+5F00UZz5gaY4ks4sKvndhJ1X96Dmfcc6oGANp5TvrV0bPkNk/WttQl EYhZKDVLLq06xgU18DhUY0gZZxConx96bFyD0h8jz71P7vZvM4pw9vmM+iDhom3E8WFL Ky9HyF+i3lPX1hjkc1RyBX1iVPc3xG/F+PvF+NyWAglbLNt0l94ucCeISCJgeeA6KuWM aTHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=QWI6zvQ9G7tcKp4qOPEjq0IE4UeDmsu5osBqyCg6Cyc=; b=A2PySqeO884aAgb7R2KrpNmK1RQigw/gm7NlzOunVeaA/OcxHcXZyUF/u+xujyaS5U ZPWfBMy6J/MxCSEmThFNZobGyFcRZz/ocCwYEAg4nCRz2qiQlZSF5iSexx9p9nBQLqCj 89nXwduy22GhAVwI/TNT6JEJF8+iL1m9vcerNZ1RVEYQwtLhzrzse3qnGGUpZT33foca 7WW2AAbVneelREllAYCDXKyAbcOiwITFyPLgQEOHtuqFrGDqud08qnorNjAE0seQJ5tk a049x3F1lbQ3uwL3zDQuLvrAcEDMtAhD97GOqX9DVFTsP3YJ8rOU3ECyxAS7c9Zc7Yr+ N9tw== 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 v21-v6si20422284plo.397.2018.09.11.12.06.41; Tue, 11 Sep 2018 12:06:58 -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 S1727332AbeILAFu (ORCPT + 99 others); Tue, 11 Sep 2018 20:05:50 -0400 Received: from mail-ua1-f66.google.com ([209.85.222.66]:46721 "EHLO mail-ua1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726713AbeILAFu (ORCPT ); Tue, 11 Sep 2018 20:05:50 -0400 Received: by mail-ua1-f66.google.com with SMTP id u11-v6so21666883uan.13; Tue, 11 Sep 2018 12:05:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QWI6zvQ9G7tcKp4qOPEjq0IE4UeDmsu5osBqyCg6Cyc=; b=c/cD9/tjyI/j0RDVxPxTr9rYELgOq3CVqb4D1GVSjbBMVc4+GWyQ9+qgsSPOzIJJTH 6iQYcZ38XOvtpzFim0fQZyc2uacWMAyi3O7Iv7AVCRSiXIKXIH6+vy8KtG4Gw2fUrH41 dwhwVX/hJ2RIZT/jEMfzDdU8/5BDpmPdRhG/9dEggtwG/KMOqKXL5MgGup3B+f/JyTcw cmN7jnXumzjB6x5Ma3Mte8RHGdW7xBk+ZoerUTKNgJh+gKAG//tF39GziqGXr9/20FNl Nf7j1AOnIda3DCciZeqR0whAdWQToYxPcvWQCiftRlAXrXcQSLTla8hVi8jkFo8VWWVf ytmw== X-Gm-Message-State: APzg51CvG/jt6UhlAX7JzkaCvASiylofJpAwGbKecyIFM6f1jlQSydtS kVarcVIRXm714TsBPNDSaMV46xOdJNcLA6fOxIo= X-Received: by 2002:a67:3241:: with SMTP id y62-v6mr9048304vsy.57.1536692708784; Tue, 11 Sep 2018 12:05:08 -0700 (PDT) MIME-Version: 1.0 References: <20180904111310.4049-1-radu_nicolae.pirea@upb.ro> <20180911093356.GE4185@dell> <20180911093917.GL2494@piout.net> <20180911153621.GP2494@piout.net> <20180911181838.GI4185@dell> <20180911185839.GA25212@piout.net> In-Reply-To: <20180911185839.GA25212@piout.net> From: Geert Uytterhoeven Date: Tue, 11 Sep 2018 21:04:56 +0200 Message-ID: Subject: Re: [PATCH v12 0/6] Driver for at91 usart in spi mode To: Alexandre Belloni Cc: Lee Jones , 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Alexandre, On Tue, Sep 11, 2018 at 8:58 PM Alexandre Belloni wrote: > On 11/09/2018 19:39:30+0100, Lee Jones wrote: > > On Tue, 11 Sep 2018, Geert Uytterhoeven wrote: > > > > > On Tue, Sep 11, 2018 at 5:36 PM Alexandre Belloni > > > wrote: > > > > On 11/09/2018 16:59:09+0200, Geert Uytterhoeven wrote: > > > > > On Tue, Sep 11, 2018 at 11:40 AM Alexandre Belloni > > > > > wrote: > > > > > > Then you'd have multiple compatible strings for the same IP which is a > > > > > > big no-no. > > > > > > > > > > It's still the same hardware device, isn't? > > > > > What if the SPI or UART slave is not on-board, but on an expansion board? > > > > > Then the SoC-specific .dtsi has no idea what mode should be used. > > > > > > > > > > Hence shouldn't the software derive the hardware mode from the full > > > > > hardware description in DT? If that's impossible (I didn't look into detail > > > > > whether an SPI bus can easily be distinguished from a UART bus), perhaps > > > > > a mode property should be added? > > > > > > > > Yes, this is exactly what is done: > > > > > > > > https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git/tree/drivers/mfd/at91-usart.c?h=ib-mfd-spi-tty-4.20-1#n33 > > > > > > OK. > > > > > > I guess the main "hackish" part is that the mfd_cell uses of_compatible, > > > which thus requires having additional compatible values? > > > > > > I think those can just be removed. AFAICS, the SPI and serial drivers already > > > match against the "at91_usart_spi" resp. "atmel_usart_serial" platform device > > > names? > > > > The hackish part of this driver is that it's using MFD for something > > which is clearly not an MFD. It's a USART device. Nothing more, > > nothing less. > > > > Does anyone have the datasheet to hand? > > It is not a simple usart, it is either a usart or a full blown SPI > controller with registers changing layout depending on the selected > mode. Otherwise, I'm not sure how you would get a USART to do SPI. Note the "S" in USART. SPI is just synchronous serial with a shared clock for transmit and receive. So the hardware is not that unrelated. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds