From patchwork Fri Jun 26 15:13:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 191833 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp588130ilg; Fri, 26 Jun 2020 08:26:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrB6tmonp3xUeJltmk/eWTj/llcUOa+L6QzPwMYYhepIhWsVehBOEAPHcz14RgiWB9MGjt X-Received: by 2002:a25:7ac5:: with SMTP id v188mr6160328ybc.237.1593185163065; Fri, 26 Jun 2020 08:26:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593185163; cv=none; d=google.com; s=arc-20160816; b=yf5nEiOLZFm76c49qUrgvScU6vprNGgKV9sY2UOeG6TUQIeUZiQIvV3Dbv97u3bI9C XEUv3eSBqpzRY25CZspy+REB5HP2u7EOibf8n7HVGfhQmys/wY7Zhjmiib9xZO3fgmzl dIsUA8SusXCnIyqsGEI4KvP6CbUWdzK9AEdadqu9gW8nOdxUyyPnNf1DHLsVNVCuNEEJ jyt3zFfCTkl4GcCJmDssYAk07Y5gkEdTkwYRTiXF0YPUm+qlg6Gr/yBElR7V4kd2oqYq 7z1LBUg7FoBtWOoPAHg2Mrx16s5Q7DTb52x5XdmC1KfQ8eraZ1E/l4ZsJMJqnwhkwjc8 y9vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=MGJixcDIgTvYDsTmGzHDvC7oKBPaR9Bngw/q3X8ML5A=; b=LfDzMUhyvRfdTxL/M37XTHakpvDXOWuLkG9dA1/LM0JQtW4Itzdv/buXd6K4NKyslw Tv7T64u8uKw2HcT0HdaYeyJ67kL8bL0Gyh9tZ5yFireawRFarZktqZqXTvqoxgJVT4DS CQyp8a/fCZv/NS79hxsYm/eRC5532vHC0F5j4oI58CPXeplSXza+8MaWeiXDmkf9u8l2 PvhQZwG0t6cXiZ4ZgERciWJqGddYWOFpVtf0g7B3j/bhyBwJEWI6p2fKOSuYe4Cm0Ec1 rcASIgTSseG9OrshdzDSiBPBlKLOYxge1rDtydwpWMAOxEHt7KJjeTsJZ6Jebn3CUsFu JUPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="tRd/GlfS"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a2si26098986ybc.177.2020.06.26.08.26.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 26 Jun 2020 08:26:03 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="tRd/GlfS"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:33720 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1joqEs-0004F7-Hp for patch@linaro.org; Fri, 26 Jun 2020 11:26:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35348) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1joq3o-0001s5-9E for qemu-devel@nongnu.org; Fri, 26 Jun 2020 11:14:36 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:53870) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1joq3m-0006DO-JY for qemu-devel@nongnu.org; Fri, 26 Jun 2020 11:14:35 -0400 Received: by mail-wm1-x32e.google.com with SMTP id j18so9157612wmi.3 for ; Fri, 26 Jun 2020 08:14:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=MGJixcDIgTvYDsTmGzHDvC7oKBPaR9Bngw/q3X8ML5A=; b=tRd/GlfSq+fFbMFybYhBW+gWTUwa7fZtEYw8RH1txvzLYUp//sgX0paVD6KfZjCuDx hiWrh2Y3+ImLKyGN7FOKF1RR3uoYA1K+2V0VFI8cmN5z98o5oUYgp8GbGxXBIPYMZ/td YsMSjmJ91ClnAlfANoIwBwb0NGXvaRyUFVvTirpTW1stml92rOWlc4IfJ+iruFlqfHHw 4l7GjpQzqcGdX93aQy/CjieHqTNILb74S08M/80Vm5VoJlfxKaxWknN573Wq7N3A7HqN ND+zD7M9bpkl6o4AOd0kDv0SyTqy5dcpMilNw1BOzTSdnwbJc1MxS72lw+hAPlqBj0iP y6nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MGJixcDIgTvYDsTmGzHDvC7oKBPaR9Bngw/q3X8ML5A=; b=FXrJhIIRpCOibm1lUeVsRgfwdXMKYw53r/2xe5QDmomms272wrwderHvBRZdPP05D2 Z3sf7CZ/YV6MjqQL8gKsv1J6Nx7PTe0BNZJfi0wsa9BYgSl/B4y4OcJlK/HXhFBXj3Kj f/5/mzjykqLWdM9fn0CsJL5NNCdhAfano9IgWKc9XoUk5xZae0PWS1SD1b8s9nYOINvq YLaIKBrTelQSxjEet5FX+ecmh+QVN4W7gA/8UMsD9KqrRPXl0swabYmwKuO2HQ6vi/Qd lTK4UW/yzuLx2rN60AiYoGiKqVWL6bvVBLdh/OYbgVDX/J9dCQTBliy6CL+ifNun7fqw GVhg== X-Gm-Message-State: AOAM533YZylU8bGxtjoa5xcCM6zrlrpHpFAEA7y6zpUVNH1rKVj0gP1W h66KZYyAVBoCqiep3XSYAZODpmLI3a5S7g== X-Received: by 2002:a7b:cb59:: with SMTP id v25mr3843942wmj.141.1593184472501; Fri, 26 Jun 2020 08:14:32 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id w13sm37838852wrr.67.2020.06.26.08.14.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2020 08:14:31 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 05/57] hw/misc/pca9552: Rename 'nr_leds' as 'pin_count' Date: Fri, 26 Jun 2020 16:13:32 +0100 Message-Id: <20200626151424.30117-6-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200626151424.30117-1-peter.maydell@linaro.org> References: <20200626151424.30117-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32e.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé The PCA9552 device does not expose LEDs, but simple pins to connnect LEDs to. To be clearer with the device model, rename 'nr_leds' as 'pin_count'. Reviewed-by: Cédric Le Goater Signed-off-by: Philippe Mathieu-Daudé Tested-by: Cédric Le Goater Message-id: 20200623072723.6324-3-f4bug@amsat.org Signed-off-by: Peter Maydell --- include/hw/misc/pca9552.h | 2 +- hw/misc/pca9552.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) -- 2.20.1 diff --git a/include/hw/misc/pca9552.h b/include/hw/misc/pca9552.h index ebb43c63fe1..bc5ed310878 100644 --- a/include/hw/misc/pca9552.h +++ b/include/hw/misc/pca9552.h @@ -26,7 +26,7 @@ typedef struct PCA9552State { uint8_t regs[PCA9552_NR_REGS]; uint8_t max_reg; - uint8_t nr_leds; + uint8_t pin_count; } PCA9552State; #endif diff --git a/hw/misc/pca9552.c b/hw/misc/pca9552.c index cac729e35af..81da757a7ea 100644 --- a/hw/misc/pca9552.c +++ b/hw/misc/pca9552.c @@ -37,7 +37,7 @@ static void pca9552_update_pin_input(PCA9552State *s) { int i; - for (i = 0; i < s->nr_leds; i++) { + for (i = 0; i < s->pin_count; i++) { uint8_t input_reg = PCA9552_INPUT0 + (i / 8); uint8_t input_shift = (i % 8); uint8_t config = pca9552_pin_get_config(s, i); @@ -185,7 +185,7 @@ static void pca9552_get_led(Object *obj, Visitor *v, const char *name, error_setg(errp, "%s: error reading %s", __func__, name); return; } - if (led < 0 || led > s->nr_leds) { + if (led < 0 || led > s->pin_count) { error_setg(errp, "%s invalid led %s", __func__, name); return; } @@ -228,7 +228,7 @@ static void pca9552_set_led(Object *obj, Visitor *v, const char *name, error_setg(errp, "%s: error reading %s", __func__, name); return; } - if (led < 0 || led > s->nr_leds) { + if (led < 0 || led > s->pin_count) { error_setg(errp, "%s invalid led %s", __func__, name); return; } @@ -291,9 +291,9 @@ static void pca9552_initfn(Object *obj) * PCA955X device */ s->max_reg = PCA9552_LS3; - s->nr_leds = 16; + s->pin_count = 16; - for (led = 0; led < s->nr_leds; led++) { + for (led = 0; led < s->pin_count; led++) { char *name; name = g_strdup_printf("led%d", led);