mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Bastien Curutchet <bastien.curutchet@bootlin.com>,
	Santosh Shilimkar <ssantosh@kernel.org>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>
Cc: linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Herve Codina <herve.codina@bootlin.com>,
	Christopher Cordahi <christophercordahi@nanometrics.ca>
Subject: Re: [PATCH v4 06/10] memory: ti-aemif: Export aemif_*_cs_timings()
Date: Thu, 21 Nov 2024 11:33:49 +0100	[thread overview]
Message-ID: <3a74b938-072e-443c-bf48-d97aff969a17@kernel.org> (raw)
In-Reply-To: <20241115132631.264609-7-bastien.curutchet@bootlin.com>

On 15/11/2024 14:26, Bastien Curutchet wrote:
>  	return 0;
>  }
> +EXPORT_SYMBOL(aemif_check_cs_timings);
>  
>  /**
>   * aemif_set_cs_timings - Set the timing configuration of a given chip select.
> @@ -173,7 +158,7 @@ static int aemif_check_cs_timings(struct aemif_cs_timings *timings)
>   *
>   * @return: 0 on success, else negative errno.
>   */
> -static int aemif_set_cs_timings(struct aemif_device *aemif, u8 cs, struct aemif_cs_timings *timings)
> +int aemif_set_cs_timings(struct aemif_device *aemif, u8 cs, struct aemif_cs_timings *timings)
>  {
>  	unsigned int offset;
>  	u32 val, set;
> @@ -195,13 +180,16 @@ static int aemif_set_cs_timings(struct aemif_device *aemif, u8 cs, struct aemif_
>  
>  	offset = A1CR_OFFSET + cs * 4;
>  
> +	mutex_lock(&aemif->config_cs_lock);
>  	val = readl(aemif->base + offset);
>  	val &= ~TIMINGS_MASK;
>  	val |= set;
>  	writel(val, aemif->base + offset);
> +	mutex_unlock(&aemif->config_cs_lock);
>  
>  	return 0;
>  }
> +EXPORT_SYMBOL(aemif_set_cs_timings);


EXPORT_SYMBOL_GPL everywhere, these are quite specific to driver's
internals, so internal implementation.

Also, all of exported functions need to have correct kerneldoc but I
think they don't. At least missing(), so maybe rest also did not conform
to kernel doc style.

>  
>  /**
>   * aemif_calc_rate - calculate timing data.
> @@ -257,10 +245,12 @@ static int aemif_config_abus(struct platform_device *pdev, int csnum)
>  	if (data->enable_ss)
>  		set |= ACR_SSTROBE_MASK;
>  
> +	mutex_lock(&aemif->config_cs_lock);
>  	val = readl(aemif->base + offset);
>  	val &= ~CONFIG_MASK;
>  	val |= set;
>  	writel(val, aemif->base + offset);
> +	mutex_unlock(&aemif->config_cs_lock);
>  
>  	return aemif_set_cs_timings(aemif, data->cs - aemif->cs_offset, &data->timings);
>  }
> @@ -399,6 +389,7 @@ static int aemif_probe(struct platform_device *pdev)
>  	if (IS_ERR(aemif->base))
>  		return PTR_ERR(aemif->base);
>  
> +	mutex_init(&aemif->config_cs_lock);
>  	if (np) {
>  		/*
>  		 * For every controller device node, there is a cs device node
> diff --git a/include/linux/memory/ti-aemif.h b/include/linux/memory/ti-aemif.h
> new file mode 100644
> index 000000000000..0640d30f6321
> --- /dev/null
> +++ b/include/linux/memory/ti-aemif.h
> @@ -0,0 +1,32 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +
> +#ifndef __TI_AEMIF_H
> +#define __TI_AEMIF_H


Use some longer header guard, e.g. __MEMORY_TI_AEMIF_H

> +
> +/**



Best regards,
Krzysztof

  reply	other threads:[~2024-11-21 10:33 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-15 13:26 [PATCH v4 00/10] Implement setup_interface() in the DaVinci NAND controller Bastien Curutchet
2024-11-15 13:26 ` [PATCH v4 01/10] memory: ti-aemif: Store timings parameter in number of cycles - 1 Bastien Curutchet
2024-11-15 19:54   ` Miquel Raynal
2024-11-21 10:26   ` Krzysztof Kozlowski
2024-11-15 13:26 ` [PATCH v4 02/10] memory: ti-aemif: Remove unnecessary local variables Bastien Curutchet
2024-11-15 19:56   ` Miquel Raynal
2024-11-15 13:26 ` [PATCH v4 03/10] memory: ti-aemif: Wrap CS timings into a struct Bastien Curutchet
2024-11-15 19:56   ` Miquel Raynal
2024-11-21 10:25   ` Krzysztof Kozlowski
2024-11-15 13:26 ` [PATCH v4 04/10] memory: ti-aemif: Create aemif_check_cs_timings() Bastien Curutchet
2024-11-15 19:58   ` Miquel Raynal
2024-11-21 10:28   ` Krzysztof Kozlowski
2024-11-21 14:56     ` Bastien Curutchet
2024-11-15 13:26 ` [PATCH v4 05/10] memory: ti-aemif: Create aemif_set_cs_timings() Bastien Curutchet
2024-11-15 13:26 ` [PATCH v4 06/10] memory: ti-aemif: Export aemif_*_cs_timings() Bastien Curutchet
2024-11-21 10:33   ` Krzysztof Kozlowski [this message]
2024-11-21 15:33     ` Bastien Curutchet
2024-11-15 13:26 ` [PATCH v4 07/10] mtd: rawnand: davinci: Always depends on TI_AEMIF Bastien Curutchet
2024-11-15 13:26 ` [PATCH v4 08/10] mtd: rawnand: davinci: Order headers alphabetically Bastien Curutchet
2024-11-15 13:26 ` [PATCH v4 09/10] mtd: rawnand: davinci: Add clock resource Bastien Curutchet
2024-11-15 13:26 ` [PATCH v4 10/10] mtd: rawnand: davinci: Implement setup_interface() operation Bastien Curutchet
2024-11-21 10:23 ` [PATCH v4 00/10] Implement setup_interface() in the DaVinci NAND controller Krzysztof Kozlowski
2024-11-21 14:51   ` Miquel Raynal

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=3a74b938-072e-443c-bf48-d97aff969a17@kernel.org \
    --to=krzk@kernel.org \
    --cc=bastien.curutchet@bootlin.com \
    --cc=christophercordahi@nanometrics.ca \
    --cc=herve.codina@bootlin.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=ssantosh@kernel.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=vigneshr@ti.com \
    /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®