Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp961609ybi; Fri, 12 Jul 2019 07:24:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqyp6XLBNXNglWmHJohKPpVwzh/gokbTz4sOxzY1ng2pNYVkBAwhKC+R1uwC074boZIpVTNX X-Received: by 2002:a17:902:a417:: with SMTP id p23mr11639892plq.136.1562941476022; Fri, 12 Jul 2019 07:24:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562941476; cv=none; d=google.com; s=arc-20160816; b=wqwsGBjRPwArfn7xVp05ctbT4of1BRBKN0l/9lnIyYZo+Lmy8QqLnPgdj6yg0Xqvak YMwQ52EbBx3Tmi0XHufIUHpkBji3uWwCklVGXHgR40mtc5i5O5ic4B9cTF7V6MwsrLCN nFZQnWfA5dTQR9prKZaZq8DBadzCQuyGx9WcCF/g/G2E6laQUW5mUKD1z1d99NS2MgAE JDoKHrfg/yarSWIHU+xlNSRJwJpMbctAEpXRXWpZEvdMRG5ZLEjWLTYerTldvO9sAG5H Zuk/sHX+3ohoJw0IcNBjFzRw7wbHrFaR8H8aKJXKQ2OCwFxpeu2pcI5BQHcuHxB7oK/Q U5PQ== 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:dkim-signature; bh=nGPJaLLrwimgpDuREnLtjr8F7xnTIflmgbQ9hHlyOpQ=; b=RaINhezOeA0Qrk4wKVCq4CmUIdkAj6Yug9j+tlUuNYqkYVkO8oCI4JpRnJVdbwpsGl CVAvE/GiSCIoH+8e/pO4S0Vu0wnF7xS3U448Jp8toV72SxGJ7WV53MWC8lc0wBk03Wwa F1E/mQjpXamhzu4PjeA0cHX6b/pMRtVSXgcjSlPFlQLtqPZGEXXeC8K1D2h/lN4dxfrW tMFjBaPKrQZBTQYTTsWzHxDv4qql4XFLlGxITyZorXWowVosEMkH6YMgTgyhz5Q5UX+c alNN8rphjEV+gLma7UcpHCS7uKgqmvGbWoEyOTLJgVHxNLTxTd5sjllGwPXxcH+G0k4j DG7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=h9jOcluI; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 138si8384222pfy.77.2019.07.12.07.24.19; Fri, 12 Jul 2019 07:24:36 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=h9jOcluI; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727345AbfGLOWp (ORCPT + 99 others); Fri, 12 Jul 2019 10:22:45 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:43608 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726602AbfGLOWp (ORCPT ); Fri, 12 Jul 2019 10:22:45 -0400 Received: by mail-io1-f66.google.com with SMTP id k20so20646843ios.10; Fri, 12 Jul 2019 07:22:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nGPJaLLrwimgpDuREnLtjr8F7xnTIflmgbQ9hHlyOpQ=; b=h9jOcluIb6ww2CKPkNW/sCP5MUssFNFfo0eU3XK9p5+YpV+7emWd40fuQ0aguUlM9O SfMrf+m/5YOcM1qa0dWndBpgkz4Qf9EGlyTiqz+6Y7JfRFAgXKOiqXiCzMj/UING1hQK scP1RFCeJ3R4/WI+CNFRDFjyahtAk+rWVWR0IuQj7nPfOfOJ66wZq62M+xb3Dc8zqLHh 7OKh5uoWtjoEXRLbSMp+jHa1EJkzjK5EAf3zVnOt4gap7JtE0RNtC7abt3UjoaIXQZKZ 9vyQ3Ys5NMV/5OAzKCJeNjBwZ+sbQ1MsrhJazHGjIncJuDsrADav8uSg9bJTbg3Z6slp LwRw== 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=nGPJaLLrwimgpDuREnLtjr8F7xnTIflmgbQ9hHlyOpQ=; b=oZ+oPpzLAOR3A+9KAikTmIFIC3wdZz6Hv7CwnwHEjwMHmpa3pPffGEHJk5ejPpiAwq bBokLNdTyrVa2Z+w++qllOOFUd7hbYBm41lAEwH/cvgN6Ud23h0QCEYjz7mOJQp9awHU 5xNalTFxXgrb8ddPFr4z/sW8Q07jY/DU/PokwbjxWkGWOCKDqCo+eu1CUUKirzLTocpC rKKQ7QuaF62o6hbdRFgL6SzhixkgMbXhoj6fr8XRMppkwv+n5cFF9bFuOf7v/qlYqz7Z oXnKIRcv1O4rZ9EycjvaLwL8AmxCARN0ZVxHOisagXlCKlVQ9zMPB6993drf0voUMlgr ShHQ== X-Gm-Message-State: APjAAAW4TT3qdQJM/w5w7ZO3MW8MYAMSOwdgI5SyL6WWU9M6Htgr2ZC6 ZJKXoBYH0LgX/F/wOscvkX7K2TCvQx4AM5lcYrg= X-Received: by 2002:a6b:3b89:: with SMTP id i131mr10329306ioa.33.1562941364182; Fri, 12 Jul 2019 07:22:44 -0700 (PDT) MIME-Version: 1.0 References: <20190703214326.41269-1-jeffrey.l.hugo@gmail.com> <20190703214512.41319-1-jeffrey.l.hugo@gmail.com> <20190706010604.GG20625@sirena.org.uk> <64ca3a74-374f-d4f3-bee6-a607cc5c0fc5@samsung.com> <10b1313f-7a60-df04-a9e3-76649b74f2f0@samsung.com> In-Reply-To: <10b1313f-7a60-df04-a9e3-76649b74f2f0@samsung.com> From: Jeffrey Hugo Date: Fri, 12 Jul 2019 08:22:33 -0600 Message-ID: Subject: Re: [PATCH 1/2] regmap: Add DSI bus support To: Andrzej Hajda Cc: Rob Clark , Mark Brown , Laurent Pinchart , David Airlie , Daniel Vetter , Bjorn Andersson , dri-devel , linux-arm-msm , Linux Kernel Mailing List 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 On Fri, Jul 12, 2019 at 7:01 AM Andrzej Hajda wrote: > > On 11.07.2019 15:56, Rob Clark wrote: > > On Thu, Jul 11, 2019 at 6:11 AM Andrzej Hajda wrote: > >> On 06.07.2019 03:06, Mark Brown wrote: > >>> On Wed, Jul 03, 2019 at 02:45:12PM -0700, Jeffrey Hugo wrote: > >>>> Add basic support with a simple implementation that utilizes the generic > >>>> read/write commands to allow device registers to be configured. > >>> This looks good to me but I really don't know anything about DSI, > >>> I'd appreciate some review from other people who do. I take it > >>> there's some spec thing in DSI that says registers and bytes must > >>> both be 8 bit? > >> > >> I am little bit confused about regmap usage here. On the one hand it > >> nicely fits to this specific driver, probably because it already uses > >> regmap_i2c. > >> > >> On the other it will be unusable for almost all current DSI drivers and > >> probably for most new drivers. Why? > >> > >> 1. DSI protocol defines actually more than 30 types of transactions[1], > >> but this patchset implements only few of them (dsi generic write/read > >> family). Is it possible to implement multiple types of transactions in > >> regmap? > >> > >> 2. There is already some set of helpers which uses dsi bus, rewriting it > >> on regmap is possible or driver could use of regmap and direct access > >> together, the question is if it is really necessary. > >> > >> 3. DSI devices are no MFDs so regmap abstraction has no big value added > >> (correct me, if there are other significant benefits). > >> > > I assume it is not *just* this one bridge that can be programmed over > > either i2c or dsi, depending on how things are wired up on the board. > > It certainly would be nice for regmap to support this case, so we > > don't have to write two different bridge drivers for the same bridge. > > I wouldn't expect a panel that is only programmed via dsi to use this. > > > On the other side supporting DSI and I2C in one driver is simply matter > of writing proper accesors. To me, this reads like your counter argument to not using regmap, is to reinvent regmap. Maybe I don't understand what you are proposing here, but it sounds like remove the regmap support, define sn65 specific accessors that just before sending the write to the bus does a check if the access needs to go over i2c or DSI. Feels like a clunky version of regmap to me. Why not use the existing "generic" framework? To your point that DSI defines over 30 message types, yes it does, but that seems to be outside of the scope. How many of those are actually for doing register access? I'm thinking just 4 (technically a hair more than that because of the multiple version of the same message) - generic read, generic write, dcs read, dcs write. I don't view regmap as a generic abstraction layer over a particular mechanism, and thus needs to support everything that mechanism does. Sending sync commands, or pixel data over DSI is outside the scope of regmap to me.