mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Erim, Salih" <salih.erim@amd.com>
To: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: jic23@kernel.org, andy@kernel.org, dlechner@baylibre.com,
	nuno.sa@analog.com, robh@kernel.org, krzk+dt@kernel.org,
	conor+dt@kernel.org, conall.ogriofa@amd.com,
	michal.simek@amd.com, linux@roeck-us.net, erimsalih@gmail.com,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v8 2/5] iio: adc: add Versal SysMon driver
Date: Wed, 17 Jun 2026 17:23:09 +0100	[thread overview]
Message-ID: <2a87a404-9fc0-49b9-9ddb-f5a4b25b78ca@amd.com> (raw)
In-Reply-To: <ajK0phP9-pt9njrb@ashevche-desk.local>

Hi Andy,

On 17/06/2026 15:52, Andy Shevchenko wrote:
> On Tue, Jun 16, 2026 at 02:15:56PM +0100, Salih Erim wrote:
>> Add the core driver and MMIO platform driver for the AMD/Xilinx Versal
>> System Monitor (SysMon) block.
>>
>> The SysMon block resides in the platform management controller (PMC) and
>> provides on-chip voltage and temperature monitoring through a 10-bit,
>> 200 kSPS ADC. It can monitor up to 160 voltage channels and 64
>> temperature satellites distributed across the SoC, with a consistent
>> sample rate of 8 kSPS per channel regardless of how many channels are
>> enabled.
>>
>> The hardware also provides four aggregate temperature registers that
>> are always present regardless of the device tree configuration: the
>> current max and min across all active satellites, and the peak and
>> trough values recorded since the last hardware reset.
>>
>> The driver is split into two compilation units:
>>    - versal-sysmon-core: Channel parsing, IIO registration, read_raw
>>    - versal-sysmon: MMIO platform driver with custom regmap accessors
>>
>> Voltage results are stored in a 19-bit modified floating-point format
>> and converted to millivolts. Temperature results are stored in Q8.7
>> signed fixed-point Celsius format and converted to millicelsius.
>>
>> The MMIO regmap backend uses a custom reg_write accessor that
>> automatically unlocks the NPI (NoC programming interface) lock
>> register before each write, as required by the hardware. The regmap
>> is configured with fast_io since the underlying MMIO accessors are
>> safe to call from atomic context.
> 
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
> 
> with a caveat of using namespaced exports (see below).

Thank you for the review!

> 
> ...
> 
>> +EXPORT_SYMBOL_GPL(devm_versal_sysmon_core_probe);
> 
> Please, also use symbol namespace.

Will use EXPORT_SYMBOL_NS_GPL(devm_versal_sysmon_core_probe, 
"VERSAL_SYSMON") and add MODULE_IMPORT_NS("VERSAL_SYSMON") to both 
platform and I2C drivers.

> 
> ...
> 
>> +static int sysmon_mmio_reg_read(void *context, unsigned int reg,
>> +                             unsigned int *val)
> 
> Make it a single line. It will be more readable.
> 
> static int sysmon_mmio_reg_read(void *context, unsigned int reg, unsigned int *val)

Done.
> 
> ...
> 
>> +static int sysmon_mmio_reg_write(void *context, unsigned int reg,
>> +                              unsigned int val)
> 
> In the similar way.
> 
> static int sysmon_mmio_reg_write(void *context, unsigned int reg, unsigned int val)

Done.

Thanks,
Salih

> 
> In both cases it's only 83 characters.
> 
> --
> With Best Regards,
> Andy Shevchenko
> 
> 


  reply	other threads:[~2026-06-17 16:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-16 13:15 [PATCH v8 0/5] " Salih Erim
2026-06-16 13:15 ` [PATCH v8 1/5] dt-bindings: iio: adc: add xlnx,versal-sysmon binding Salih Erim
2026-06-16 13:15 ` [PATCH v8 2/5] iio: adc: add Versal SysMon driver Salih Erim
2026-06-17 14:52   ` Andy Shevchenko
2026-06-17 16:23     ` Erim, Salih [this message]
2026-06-16 13:15 ` [PATCH v8 3/5] iio: adc: versal-sysmon: add I2C driver Salih Erim
2026-06-17 14:53   ` Andy Shevchenko
2026-06-17 16:24     ` Erim, Salih
2026-06-16 13:15 ` [PATCH v8 4/5] iio: adc: versal-sysmon: add threshold event support Salih Erim
2026-06-17 15:38   ` Andy Shevchenko
2026-06-17 16:34     ` Erim, Salih
2026-06-16 13:15 ` [PATCH v8 5/5] iio: adc: versal-sysmon: add oversampling support Salih Erim
2026-06-17 15:42   ` Andy Shevchenko
2026-06-17 16:34     ` Erim, Salih

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2a87a404-9fc0-49b9-9ddb-f5a4b25b78ca@amd.com \
    --to=salih.erim@amd.com \
    --cc=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=conall.ogriofa@amd.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=erimsalih@gmail.com \
    --cc=jic23@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=michal.simek@amd.com \
    --cc=nuno.sa@analog.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®