From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Brown Subject: Re: [PATCH 1/2] regmap: Add DSI bus support Date: Sat, 6 Jul 2019 02:06:04 +0100 Message-ID: <20190706010604.GG20625@sirena.org.uk> References: <20190703214326.41269-1-jeffrey.l.hugo@gmail.com> <20190703214512.41319-1-jeffrey.l.hugo@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0924062032==" Return-path: Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [IPv6:2a01:7e01::f03c:91ff:fed4:a3b6]) by gabe.freedesktop.org (Postfix) with ESMTPS id EAF2E6E568 for ; Sat, 6 Jul 2019 01:06:09 +0000 (UTC) In-Reply-To: <20190703214512.41319-1-jeffrey.l.hugo@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Jeffrey Hugo Cc: airlied@linux.ie, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, bjorn.andersson@linaro.org, Laurent.pinchart@ideasonboard.com List-Id: dri-devel@lists.freedesktop.org --===============0924062032== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="3yNHWXBV/QO9xKNm" Content-Disposition: inline --3yNHWXBV/QO9xKNm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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? A couple of minor comments, no need to resend just for these: > + payload[0] = (char)reg; > + payload[1] = (char)val; Do you need the casts? > + ret = mipi_dsi_generic_write(dsi, payload, 2); > + return ret < 0 ? ret : 0; Please just write an if statement, it helps with legibility. > +struct regmap *__regmap_init_dsi(struct mipi_dsi_device *dsi, > + const struct regmap_config *config, > + struct lock_class_key *lock_key, > + const char *lock_name) > +{ > + return __regmap_init(&dsi->dev, &dsi_bus, &dsi->dev, config, > + lock_key, lock_name); > +} > +EXPORT_SYMBOL_GPL(__regmap_init_dsi); Perhaps validate that the config is OK (mainly the register/value sizes)? Though I'm not sure it's worth it so perhaps not - up to you. --3yNHWXBV/QO9xKNm Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl0f8/sACgkQJNaLcl1U h9B+BAf+OQ42/IKead1kROPCuJvRz9xl+9GDQTLlYbT3gv9XzJqILZvnKJdtFtnQ FIjvDBpN7fxvlXZtGAwrMOa5udFoKi2r1HTWeXW9qO3YYOrm06gt22+EsO/176rb BGCshVkG6DOZGHT858SLkWlNN6pXuu7//4vJMfGsnKNI3KEc9jGHI3U3KoF3jNyi pGlJPPGvvJhA9Nr3bdJuCD5eo/zAyjqsFE5NaynitGMU5Gzc9qZZWx7XtqA6qbz+ mPMDlUK9mXLu5/HkFyyTptJAZrbDGGWnpSMBDt4X92plAc07q82hWWlgEdaq2pEW O8LOCJGyLJrkFlhw41aL4GO7nqMMqg== =xAto -----END PGP SIGNATURE----- --3yNHWXBV/QO9xKNm-- --===============0924062032== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVs --===============0924062032==--