Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp14158ima; Thu, 31 Jan 2019 11:35:07 -0800 (PST) X-Google-Smtp-Source: ALg8bN76YOpjAixmrpDE/A7PUnbgaUX5xmdc3a6vDiwfqFTOXA8BH3wXX4PXOFghMW+6wMdQru8a X-Received: by 2002:aa7:8286:: with SMTP id s6mr35392476pfm.63.1548963307078; Thu, 31 Jan 2019 11:35:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548963307; cv=none; d=google.com; s=arc-20160816; b=JWDn3c8rEX2cEHLCt6onZ3x2Qn6BcNDFFer0JBCGVuZn4Atg+4kdwBI2oukxiSnMOX SaBLCMGCFfHraso39pL2r1n7yaje19BomLPpuZ8k88u623A8gvqyQ9MNpiQGmoOfReVT UzcjmxdvWxwH3CvyHTbKlX3003jDSYYTpzvw4dT5dTgOpNwGSIUE3Jnfu+itzIvxcmkx fT2tDweBOQ7zYmNdYTQfFN5gDRDKOEspo/VSTC0i2fQKLnf+Q2kAY1xHyxznNxAri6Qd JEWKh5AeNEg1vTAVdnTRyMd129htg1YJd4WRxauzLJajIEjo2kZjJXAULoYzIIbjVbp3 2EFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=M/Pt+HtUozx+9QMt6Rr3VaNIFQgfWtVo+mrMkt7RTBA=; b=Gb4bxPlym2HmFw+2VM7Wt1R19bwKUO3CRa1K5NKyEsVAbpyCiQPJ6SzHEMKDWgiqi1 iQpo2pylg3js7X1wA3ca9l8SqU/HVbjpxKpacuKBbABecze5LlTGZCB96NkHQMdKpFoV 973OiqhR4eY4sDdBelLc3hzmf3mp5+tHVtsgQS6ZEF0tAUCukLKNfn8u/hotQK1XR79G NvztuMiR2YxV34hNFytDL+UDYKvswTJrBg+tIVB2kLQH+GwzylQ1Gq8cfgq0LBr5UWWF nHRmKLN+/OMYVOr0XHvRhfk5B9/tEcbTZAfjsj7gQxK7qPydk8ezjvtg+Yccwno7H/PN CFAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=hhGUDe8R; 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 j70si4680656pgd.138.2019.01.31.11.34.51; Thu, 31 Jan 2019 11:35:07 -0800 (PST) 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=fail header.i=@gmail.com header.s=20161025 header.b=hhGUDe8R; 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 S1729031AbfAaT1y (ORCPT + 99 others); Thu, 31 Jan 2019 14:27:54 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:35443 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728721AbfAaT0n (ORCPT ); Thu, 31 Jan 2019 14:26:43 -0500 Received: by mail-lj1-f196.google.com with SMTP id x85-v6so3714502ljb.2 for ; Thu, 31 Jan 2019 11:26:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=M/Pt+HtUozx+9QMt6Rr3VaNIFQgfWtVo+mrMkt7RTBA=; b=hhGUDe8RAEHLFG+PQzlNwfGWQcvetDCBV+AzqVkzCSyAog/bjmfRxb4m6TIbPkQvz+ 0IULzAnIzmkyY8kZbjDkqR6/QAOfdjcMwjHHJugr+DEJX2uqYeWEwaYesWR21fOdYYg6 HwHo7Z0zwrwIRFwHtskCqG2vLNdhqhLKoamIy3M9LIg5mgGFDaVkXqIZsMsN2UcFeYDZ aMDdiVM+Y/C9694QN2qC6yOFnm11dKvELxH7xdWMphlcWydGt+uLixQqMPjnKYMH5uhU x73eJoW/urq5/WWA3Too5CPxbcCbc18FKkIzFVLMh8iwILJHE+B7nLsH3zWCHejL5KSo 9c3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=M/Pt+HtUozx+9QMt6Rr3VaNIFQgfWtVo+mrMkt7RTBA=; b=P5PJ+uLqGUSAbmxTOcreSiaAqK9Ib/a6xSI/TEXpw08k4U26rLtrI4LN8cA55gHsvu 5CuvZa1DTFtAhCMcVX7y4GynhuOm4d3zF/ffiSUNiogpyNYG4vAiciuulXyjQSaWqKZR xei0OrfspKfcR0CszgfhGLc+Xc+yKuCilJSMvvo2s+KW/7F2jS8Ligm4hOKRbRKQUBZF jpf1jvvoUUjNZg0aYByViiTK8VTjxDbUGYXnfY1JTIdWBR1Cgf1p/K575zGnVXleFLwH 2RvUureoysQYFjdQLIuR6/uBbkEmMkpemxkifsTV+xmcvQS8LQykh2ytVhufvKzTcJdv 5tIg== X-Gm-Message-State: AJcUukf+wjp8B//3H1S3OnsncXWD4Tb56+yQZYFX3a06NqZ8OcE/zriv J7+bDItRdRq8qMPJq45vuqA= X-Received: by 2002:a2e:86ca:: with SMTP id n10-v6mr25804389ljj.49.1548962801392; Thu, 31 Jan 2019 11:26:41 -0800 (PST) Received: from jupiter.lan (18.158-248-194.customer.lyse.net. [158.248.194.18]) by smtp.gmail.com with ESMTPSA id f1sm987363lfm.22.2019.01.31.11.26.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 Jan 2019 11:26:40 -0800 (PST) From: Sam Ravnborg To: Thierry Reding , dri-devel@lists.freedesktop.org Cc: Daniel Vetter , David Airlie , Linus Walleij , Stefan Mavrodiev , linux-kernel@vger.kernel.org, Sam Ravnborg Subject: [PATCH v1 07/19] drm/panel: ilitek: use DRM_DEV* Date: Thu, 31 Jan 2019 20:26:07 +0100 Message-Id: <20190131192619.9763-8-sam@ravnborg.org> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190131192619.9763-1-sam@ravnborg.org> References: <20190131192619.9763-1-sam@ravnborg.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Introduce use of DRM_DEV* for logging. This makes logging in the drm subsystem more consistent. Signed-off-by: Sam Ravnborg Cc: Thierry Reding Cc: David Airlie Cc: Daniel Vetter --- drivers/gpu/drm/panel/panel-ilitek-ili9322.c | 93 +++++++++++++++------------ drivers/gpu/drm/panel/panel-ilitek-ili9881c.c | 14 ++-- 2 files changed, 60 insertions(+), 47 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c index 1ee8b2ccf718..e5e60347d3cf 100644 --- a/drivers/gpu/drm/panel/panel-ilitek-ili9322.c +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9322.c @@ -302,7 +302,7 @@ static int ili9322_regmap_spi_write(void *context, const void *data, memcpy(buf, data, 2); buf[0] &= ~0x80; - dev_dbg(dev, "WRITE: %02x %02x\n", buf[0], buf[1]); + DRM_DEV_DEBUG(dev, "WRITE: %02x %02x\n", buf[0], buf[1]); return spi_write_then_read(spi, buf, 2, NULL, 0); } @@ -315,8 +315,8 @@ static int ili9322_regmap_spi_read(void *context, const void *reg, /* Set bit 7 to 1 to read */ memcpy(buf, reg, 1); - dev_dbg(dev, "READ: %02x reg size = %zu, val size = %zu\n", - buf[0], reg_size, val_size); + DRM_DEV_DEBUG(dev, "READ: %02x reg size = %zu, val size = %zu\n", + buf[0], reg_size, val_size); buf[0] |= 0x80; return spi_write_then_read(spi, buf, 1, val, 1); @@ -362,7 +362,7 @@ static int ili9322_init(struct drm_panel *panel, struct ili9322 *ili) ret = regmap_write(ili->regmap, ILI9322_GLOBAL_RESET, ILI9322_GLOBAL_RESET_ASSERT); if (ret) { - dev_err(ili->dev, "can't issue GRESET (%d)\n", ret); + DRM_DEV_ERROR(ili->dev, "can't issue GRESET (%d)\n", ret); return ret; } @@ -371,7 +371,8 @@ static int ili9322_init(struct drm_panel *panel, struct ili9322 *ili) ret = regmap_write(ili->regmap, ILI9322_VREG1_VOLTAGE, ili->vreg1out); if (ret) { - dev_err(ili->dev, "can't set up VREG1OUT (%d)\n", ret); + DRM_DEV_ERROR(ili->dev, + "can't set up VREG1OUT (%d)\n", ret); return ret; } } @@ -380,8 +381,9 @@ static int ili9322_init(struct drm_panel *panel, struct ili9322 *ili) ret = regmap_write(ili->regmap, ILI9322_VCOM_AMP, ili->vcom_amplitude); if (ret) { - dev_err(ili->dev, - "can't set up VCOM amplitude (%d)\n", ret); + DRM_DEV_ERROR(ili->dev, + "can't set up VCOM amplitude (%d)\n", + ret); return ret; } }; @@ -390,7 +392,8 @@ static int ili9322_init(struct drm_panel *panel, struct ili9322 *ili) ret = regmap_write(ili->regmap, ILI9322_VCOM_HIGH, ili->vcom_high); if (ret) { - dev_err(ili->dev, "can't set up VCOM high (%d)\n", ret); + DRM_DEV_ERROR(ili->dev, + "can't set up VCOM high (%d)\n", ret); return ret; } }; @@ -400,9 +403,9 @@ static int ili9322_init(struct drm_panel *panel, struct ili9322 *ili) ret = regmap_write(ili->regmap, ILI9322_GAMMA_1 + i, ili->gamma[i]); if (ret) { - dev_err(ili->dev, - "can't write gamma V%d to 0x%02x (%d)\n", - i + 1, ILI9322_GAMMA_1 + i, ret); + DRM_DEV_ERROR(ili->dev, + "can't write gamma V%d to 0x%02x (%d)\n", + i + 1, ILI9322_GAMMA_1 + i, ret); return ret; } } @@ -434,7 +437,8 @@ static int ili9322_init(struct drm_panel *panel, struct ili9322 *ili) reg |= ILI9322_POL_VSYNC; ret = regmap_write(ili->regmap, ILI9322_POL, reg); if (ret) { - dev_err(ili->dev, "can't write POL register (%d)\n", ret); + DRM_DEV_ERROR(ili->dev, + "can't write POL register (%d)\n", ret); return ret; } @@ -446,7 +450,8 @@ static int ili9322_init(struct drm_panel *panel, struct ili9322 *ili) reg |= ILI9322_IF_CTRL_LINE_INVERSION; ret = regmap_write(ili->regmap, ILI9322_IF_CTRL, reg); if (ret) { - dev_err(ili->dev, "can't write IF CTRL register (%d)\n", ret); + DRM_DEV_ERROR(ili->dev, + "can't write IF CTRL register (%d)\n", ret); return ret; } @@ -460,14 +465,14 @@ static int ili9322_init(struct drm_panel *panel, struct ili9322 *ili) reg |= ILI9322_ENTRY_AUTODETECT; ret = regmap_write(ili->regmap, ILI9322_ENTRY, reg); if (ret) { - dev_err(ili->dev, "can't write ENTRY reg (%d)\n", ret); + DRM_DEV_ERROR(ili->dev, "can't write ENTRY reg (%d)\n", ret); return ret; } - dev_info(ili->dev, "display is in %s mode, syncmode %02x\n", - ili9322_inputs[ili->input], + DRM_DEV_INFO(ili->dev, "display is in %s mode, syncmode %02x\n", + ili9322_inputs[ili->input], ili->conf->syncmode); - dev_info(ili->dev, "initialized display\n"); + DRM_DEV_INFO(ili->dev, "initialized display\n"); return 0; } @@ -484,7 +489,7 @@ static int ili9322_power_on(struct ili9322 *ili) ret = regulator_bulk_enable(ARRAY_SIZE(ili->supplies), ili->supplies); if (ret < 0) { - dev_err(ili->dev, "unable to enable regulators\n"); + DRM_DEV_ERROR(ili->dev, "unable to enable regulators\n"); return ret; } msleep(20); @@ -510,7 +515,7 @@ static int ili9322_disable(struct drm_panel *panel) ret = regmap_write(ili->regmap, ILI9322_POW_CTRL, ILI9322_POW_CTRL_STANDBY); if (ret) { - dev_err(ili->dev, "unable to go to standby mode\n"); + DRM_DEV_ERROR(ili->dev, "unable to go to standby mode\n"); return ret; } @@ -548,7 +553,7 @@ static int ili9322_enable(struct drm_panel *panel) ret = regmap_write(ili->regmap, ILI9322_POW_CTRL, ILI9322_POW_CTRL_DEFAULT); if (ret) { - dev_err(ili->dev, "unable to enable panel\n"); + DRM_DEV_ERROR(ili->dev, "unable to enable panel\n"); return ret; } @@ -756,7 +761,7 @@ static int ili9322_probe(struct spi_device *spi) */ ili->conf = of_device_get_match_data(dev); if (!ili->conf) { - dev_err(dev, "missing device configuration\n"); + DRM_DEV_ERROR(dev, "missing device configuration\n"); return -ENODEV; } @@ -766,20 +771,21 @@ static int ili9322_probe(struct spi_device *spi) ili->vreg1out = U8_MAX; } else { if (val < 3600) { - dev_err(dev, "too low VREG1OUT\n"); + DRM_DEV_ERROR(dev, "too low VREG1OUT\n"); return -EINVAL; } if (val > 6000) { - dev_err(dev, "too high VREG1OUT\n"); + DRM_DEV_ERROR(dev, "too high VREG1OUT\n"); return -EINVAL; } if ((val % 100) != 0) { - dev_err(dev, "VREG1OUT is no even 100 microvolt\n"); + DRM_DEV_ERROR(dev, + "VREG1OUT is no even 100 microvolt\n"); return -EINVAL; } val -= 3600; val /= 100; - dev_dbg(dev, "VREG1OUT = 0x%02x\n", val); + DRM_DEV_DEBUG(dev, "VREG1OUT = 0x%02x\n", val); ili->vreg1out = val; } @@ -789,15 +795,15 @@ static int ili9322_probe(struct spi_device *spi) ili->vcom_high = U8_MAX; } else { if (val < 37) { - dev_err(dev, "too low VCOM high\n"); + DRM_DEV_ERROR(dev, "too low VCOM high\n"); return -EINVAL; } if (val > 100) { - dev_err(dev, "too high VCOM high\n"); + DRM_DEV_ERROR(dev, "too high VCOM high\n"); return -EINVAL; } val -= 37; - dev_dbg(dev, "VCOM high = 0x%02x\n", val); + DRM_DEV_DEBUG(dev, "VCOM high = 0x%02x\n", val); ili->vcom_high = val; } @@ -807,34 +813,38 @@ static int ili9322_probe(struct spi_device *spi) ili->vcom_high = U8_MAX; } else { if (val < 70) { - dev_err(dev, "too low VCOM amplitude\n"); + DRM_DEV_ERROR(dev, "too low VCOM amplitude\n"); return -EINVAL; } if (val > 132) { - dev_err(dev, "too high VCOM amplitude\n"); + DRM_DEV_ERROR(dev, "too high VCOM amplitude\n"); return -EINVAL; } val -= 70; val >>= 1; /* Increments of 2% */ - dev_dbg(dev, "VCOM amplitude = 0x%02x\n", val); + DRM_DEV_DEBUG(dev, "VCOM amplitude = 0x%02x\n", val); ili->vcom_amplitude = val; } for (i = 0; i < ARRAY_SIZE(ili->gamma); i++) { val = ili->conf->gamma_corr_neg[i]; if (val > 15) { - dev_err(dev, "negative gamma %u > 15, capping\n", val); + DRM_DEV_ERROR(dev, + "negative gamma %u > 15, capping\n", + val); val = 15; } gamma = val << 4; val = ili->conf->gamma_corr_pos[i]; if (val > 15) { - dev_err(dev, "positive gamma %u > 15, capping\n", val); + DRM_DEV_ERROR(dev, + "positive gamma %u > 15, capping\n", + val); val = 15; } gamma |= val; ili->gamma[i] = gamma; - dev_dbg(dev, "gamma V%d: 0x%02x\n", i + 1, gamma); + DRM_DEV_DEBUG(dev, "gamma V%d: 0x%02x\n", i + 1, gamma); } ili->supplies[0].supply = "vcc"; /* 2.7-3.6 V */ @@ -859,32 +869,32 @@ static int ili9322_probe(struct spi_device *spi) ili->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH); if (IS_ERR(ili->reset_gpio)) { - dev_err(dev, "failed to get RESET GPIO\n"); + DRM_DEV_ERROR(dev, "failed to get RESET GPIO\n"); return PTR_ERR(ili->reset_gpio); } spi->bits_per_word = 8; ret = spi_setup(spi); if (ret < 0) { - dev_err(dev, "spi setup failed.\n"); + DRM_DEV_ERROR(dev, "spi setup failed.\n"); return ret; } regmap_config = &ili9322_regmap_config; ili->regmap = devm_regmap_init(dev, &ili9322_regmap_bus, dev, regmap_config); if (IS_ERR(ili->regmap)) { - dev_err(dev, "failed to allocate register map\n"); + DRM_DEV_ERROR(dev, "failed to allocate register map\n"); return PTR_ERR(ili->regmap); } ret = regmap_read(ili->regmap, ILI9322_CHIP_ID, &val); if (ret) { - dev_err(dev, "can't get chip ID (%d)\n", ret); + DRM_DEV_ERROR(dev, "can't get chip ID (%d)\n", ret); return ret; } if (val != ILI9322_CHIP_ID_MAGIC) { - dev_err(dev, "chip ID 0x%0x2, expected 0x%02x\n", val, - ILI9322_CHIP_ID_MAGIC); + DRM_DEV_ERROR(dev, "chip ID 0x%0x2, expected 0x%02x\n", val, + ILI9322_CHIP_ID_MAGIC); return -ENODEV; } @@ -892,7 +902,8 @@ static int ili9322_probe(struct spi_device *spi) if (ili->conf->input == ILI9322_INPUT_UNKNOWN) { ret = regmap_read(ili->regmap, ILI9322_ENTRY, &val); if (ret) { - dev_err(dev, "can't get entry setting (%d)\n", ret); + DRM_DEV_ERROR(dev, + "can't get entry setting (%d)\n", ret); return ret; } /* Input enum corresponds to HW setting */ diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c index 3ad4a46c4e94..f72059578c74 100644 --- a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c @@ -18,6 +18,7 @@ #include #include #include +#include #include