From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751936AbdBOL0N (ORCPT ); Wed, 15 Feb 2017 06:26:13 -0500 Received: from mx0a-001ae601.pphosted.com ([67.231.149.25]:54334 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751564AbdBOL0M (ORCPT ); Wed, 15 Feb 2017 06:26:12 -0500 Authentication-Results: ppops.net; spf=none smtp.mailfrom=ckeepax@opensource.wolfsonmicro.com Date: Wed, 15 Feb 2017 11:24:25 +0000 From: Charles Keepax To: Baoyou Xie CC: , , , , , , , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH v1 3/3] ASoC: zx-96p22: add zte's aud96p22 controller driver Message-ID: <20170215112425.GC30007@localhost.localdomain> References: <1487156110-12840-1-git-send-email-baoyou.xie@linaro.org> <1487156110-12840-3-git-send-email-baoyou.xie@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1487156110-12840-3-git-send-email-baoyou.xie@linaro.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1702150111 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 15, 2017 at 06:55:10PM +0800, Baoyou Xie wrote: > This patch adds aud96p22 controller driver for zte's SoC family. > > Signed-off-by: Baoyou Xie > --- > +static int zx_aud96p22_i2c_write(struct i2c_client *i2c_client, > + const void *data, size_t count) > +{ > + int xfer; > + > + xfer = i2c_master_send(i2c_client, data, count); > + if (xfer == count) > + return 0; > + else if (xfer < 0) > + return xfer; > + else > + return -EIO; > +} > + > +static int zx_aud96p22_i2c_read(struct i2c_client *i2c_client, > + unsigned char addr) > +{ > + int xfer; > + > + xfer = i2c_smbus_read_word_data(i2c_client, addr); > + if (xfer < 0) > + dev_warn(&i2c_client->dev, "transfer error %d\n", xfer); > + > + return xfer; > +} > + Is there any reason this isn't using regmap? It looks like it should be, have a look at any of the other mainline CODECs for an example. Thanks, Charles