Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3762480imm; Thu, 17 May 2018 14:23:15 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqZyHz52B3yuL4xSW/ymyOt+TQEMqNLXUQlpw9cn41WBufxZQBZYk86mgdngkW6PBlZpvG9 X-Received: by 2002:a62:104a:: with SMTP id y71-v6mr6535699pfi.188.1526592195041; Thu, 17 May 2018 14:23:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526592195; cv=none; d=google.com; s=arc-20160816; b=jHrUkzJv39EURNL4WNcv+DYdZvBjRB9UMucz4fPZ1/nwr8yF5191F4K2fJ3hnBGdlG XmpJamUpzDqFyEkqXiKklhkPWOHigQOVkJI/2cQtesGXW64SDUTL8k2kd77119WStBWP omJhHfV6Fh6N2iTzRa2kKiH3rzj9cs8uYooFtjkk03Ch49m1ssceZSR2dVQZ2jGjRX2w UzyzYPMtZ5s870bGhBW82DqiB08zmZIf6iWioi0SmNWCjHHnnuY/fYq8LJd7r3rUlJAO CP8yoXu2esknf3lpjCqzXLVCI9I9FOB8TbCbiS0XHsgteAaTeSHD9K4QTmG4kx7opo94 MKbw== 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 :references:in-reply-to:mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=gd6GRbkH0z6ErS1BgSwXm24o3nlvubSZBzhA/Q6VGPM=; b=n1AeKBzyqTNB1bz4VTASpRWyDVJ2Tv7lCR9r9w5Bz5/6Nael/WuY/WdrdL5R1SbmvI qipYNgl7+6Y0TM7pnpSzR1FFzod/AbIJNWqcdGpzKrMAQsDbDawIVLJJtR8cI5y7F72F 1lOSvmTPuSM29HFIOpzDFjmNXpQKlv0C7DRFqdMRgo0xg9S+7waALBs+CCT2p0CoUWbU xT4JcLTLVPzkAxvKj63Wk02GJf8EgYkrhuD/Jnt7G3qXeLotaPoq6W4kdGg6uiKdXKT1 26dmjV0MijDXTQqO2rLIAroUCwqWGgBwCfCl2k8SbXqsBrRFBWvruZ5Ak3JDhVFTtZVw iL0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@google.com header.s=20161025 header.b=CqMWvFUH; dkim=fail header.i=@chromium.org header.s=google header.b=NABd4Uod; 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=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b10-v6si5942090pla.282.2018.05.17.14.23.00; Thu, 17 May 2018 14:23:15 -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=fail header.i=@google.com header.s=20161025 header.b=CqMWvFUH; dkim=fail header.i=@chromium.org header.s=google header.b=NABd4Uod; 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=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752062AbeEQVWO (ORCPT + 99 others); Thu, 17 May 2018 17:22:14 -0400 Received: from mail-vk0-f66.google.com ([209.85.213.66]:43304 "EHLO mail-vk0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751971AbeEQVWL (ORCPT ); Thu, 17 May 2018 17:22:11 -0400 Received: by mail-vk0-f66.google.com with SMTP id x191-v6so3598668vke.10 for ; Thu, 17 May 2018 14:22:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=gd6GRbkH0z6ErS1BgSwXm24o3nlvubSZBzhA/Q6VGPM=; b=CqMWvFUHZsBzA+LlJMCXwrSjQcZSz5xZ/b5OTJLppIf1xJkswHDcFjYGWu75lxUm0L qfZ+Xuo+dCDKvq5Ztj+WeYjMV2eXL3+BeCpWNs6WuAa0JIq2F0Ct5AHZsIABVwAprcig dUNH/QVosM2tBq7CrKEKyHe4R9r5spY1GOZHXQq0m5wczsmCHjrejHfO+km8wNZy7oT/ rnJh3sdZF2Sx0piVT65LIw6Sqv2WZhAZk5Y6Xx9i9uyA9M4mlKbkj2QLVCgTxJ5xfzAK ddRG9AIO1AEsbiC0Gwe5c4cv/OOnoIJN0KjzMwalbWIom1CoX3i3PxDELiyXhlPeBnd3 Qtkw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=gd6GRbkH0z6ErS1BgSwXm24o3nlvubSZBzhA/Q6VGPM=; b=NABd4Uod63g36Xt+ZmLrBhjhRBbgOUdBK9GI2Z/ga+Oqm2vNuctPf36Qs4Bzgf4D+Y pkymyqIBq7vbnAJddxAks1leSXxSRSSX1KZfyApRaSU7ZU+0vJbLM6gI9g0rck+/kJlr cj/OSGbWINcr09ufcwX6jYlMtNNBj9vfC6C/E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=gd6GRbkH0z6ErS1BgSwXm24o3nlvubSZBzhA/Q6VGPM=; b=gZ2Up4ty0t1ZHn1W84MdgKn8tz1k3jqbIqCEmiRZbi1jqfCdFRG2+GxwoB/QUMUwjm A71+HzFcNWgErQYRuMNSEJxuEPR2QLJJGdNzDlH1xNVbxBUq4xvY9hWPT4jQXs/O9/Yv XDR46fddorWeSITvFHaAAyWw8ZSBuUqjYWGIkvc9nwVNMhx40TQDWcRME75G1lW3U6W1 9tQL+GH0n+KG9GWrXU/l9r9WC75hBjKiqEUx/os39Z9v0B+ERAWUIutGVcc9dn4/g/+a uf2O/2rAn6tBrn2LJWTnp+bxp5UqBXb6nQI94EQGxlzZ4iMaY4WQ1F3559ycHiHICHX6 cjSA== X-Gm-Message-State: ALKqPwdcQx0R1RNI3hq6PvnEWmYKXbYsf4PUI68EdgamYXrVXsYGL8oo mFxb1s89At+tJk/IchIODNC+w1IizsLK9NgMK5Y/lQ== X-Received: by 2002:a1f:bd56:: with SMTP id n83-v6mr5188007vkf.60.1526592130623; Thu, 17 May 2018 14:22:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.31.48.82 with HTTP; Thu, 17 May 2018 14:22:09 -0700 (PDT) In-Reply-To: <58bb4f965515a67a6cbbc726b0d7b092c22b79d7.1526088289.git.collinsd@codeaurora.org> References: <58bb4f965515a67a6cbbc726b0d7b092c22b79d7.1526088289.git.collinsd@codeaurora.org> From: Doug Anderson Date: Thu, 17 May 2018 14:22:09 -0700 X-Google-Sender-Auth: MY9aaknfyl2NAWnc8VhcNuplgx0 Message-ID: Subject: Re: [PATCH 2/2] regulator: of: add support for allowed modes configuration To: David Collins Cc: Mark Brown , Liam Girdwood , Rob Herring , Mark Rutland , linux-arm-msm@vger.kernel.org, Linux ARM , devicetree@vger.kernel.org, LKML , Rajendra Nayak , Stephen Boyd 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 Hi, On Fri, May 11, 2018 at 6:46 PM, David Collins wrote: > @@ -136,6 +136,33 @@ static void of_get_regulation_constraints(struct device_node *np, > } > } > > + len = of_property_count_elems_of_size(np, "regulator-allowed-modes", > + sizeof(u32)); > + if (len > 0) { > + if (desc && desc->of_map_mode) { > + for (i = 0; i < len; i++) { > + ret = of_property_read_u32_index(np, > + "regulator-allowed-modes", i, &pval); > + if (ret) { > + pr_err("%s: couldn't read allowed modes index %d, ret=%d\n", > + np->name, i, ret); > + break; > + } > + mode = desc->of_map_mode(pval); > + if (mode == REGULATOR_MODE_INVALID) > + pr_err("%s: invalid regulator-allowed-modes element %u\n", > + np->name, pval); > + else > + constraints->valid_modes_mask |= mode; > + } > + if (constraints->valid_modes_mask) > + constraints->valid_ops_mask > + |= REGULATOR_CHANGE_MODE; Kinda calls into question the value of REGULATOR_CHANGE_MODE in the valid_ops_mask if it's just set whenever valid_modes_mask is non-zero, huh? > + } else { > + pr_warn("%s: mode mapping not defined\n", np->name); > + } > + } > + This patch seems good to me. Reviewed-by: Douglas Anderson