mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Randy Dunlap <randy.dunlap@oracle.com>
To: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
Cc: grant.likely@secretlab.ca, linuxppc-dev@ozlabs.org,
	jirislaby@gmail.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [POWERPC] Xilinx: hwicap driver
Date: Fri, 8 Feb 2008 08:49:54 -0800	[thread overview]
Message-ID: <20080208084954.9c311e36.randy.dunlap@oracle.com> (raw)
In-Reply-To: <20080208021747.92253161805C@mail10-sin.bigfish.com>

On Thu,  7 Feb 2008 18:17:41 -0800 Stephen Neuendorffer wrote:

>  drivers/char/Kconfig                       |    7 +
>  drivers/char/Makefile                      |    1 +
>  drivers/char/xilinx_hwicap/Makefile        |    7 +
>  drivers/char/xilinx_hwicap/buffer_icap.c   |  380 ++++++++++++
>  drivers/char/xilinx_hwicap/buffer_icap.h   |   57 ++
>  drivers/char/xilinx_hwicap/fifo_icap.c     |  381 ++++++++++++
>  drivers/char/xilinx_hwicap/fifo_icap.h     |   62 ++
>  drivers/char/xilinx_hwicap/xilinx_hwicap.c |  923 ++++++++++++++++++++++++++++
>  drivers/char/xilinx_hwicap/xilinx_hwicap.h |  193 ++++++
>  9 files changed, 2011 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/char/xilinx_hwicap/Makefile
>  create mode 100644 drivers/char/xilinx_hwicap/buffer_icap.c
>  create mode 100644 drivers/char/xilinx_hwicap/buffer_icap.h
>  create mode 100644 drivers/char/xilinx_hwicap/fifo_icap.c
>  create mode 100644 drivers/char/xilinx_hwicap/fifo_icap.h
>  create mode 100644 drivers/char/xilinx_hwicap/xilinx_hwicap.c
>  create mode 100644 drivers/char/xilinx_hwicap/xilinx_hwicap.h
> 
> diff --git a/drivers/char/xilinx_hwicap/buffer_icap.c b/drivers/char/xilinx_hwicap/buffer_icap.c
> new file mode 100644
> index 0000000..dfea2bd
> --- /dev/null
> +++ b/drivers/char/xilinx_hwicap/buffer_icap.c
> @@ -0,0 +1,380 @@

> +/**
> + * buffer_icap_get_status: Get the contents of the status register.
> + * @parameter base_address: is the base address of the device
> + *

Hi,
For this function and many others in these source files:
Please see Documentation/kernel-doc-nano-HOWTO.txt for the correct
kernel-doc notation format.

If you have questions or need help, please ask.

Hints:
a. function name & short description: separate name & description with '-'
b. parameters are listed as: @base_address: (without "parameter")


> + * The status register contains the ICAP status and the done bit.
> + *
> + * D8 - cfgerr
> + * D7 - dalign
> + * D6 - rip
> + * D5 - in_abort_l
> + * D4 - Always 1
> + * D3 - Always 1
> + * D2 - Always 1
> + * D1 - Always 1
> + * D0 - Done bit
> + **/
> +static inline u32 buffer_icap_get_status(void __iomem *base_address)
> +{
> +	return in_be32(base_address + XHI_STATUS_REG_OFFSET);
> +}


> diff --git a/drivers/char/xilinx_hwicap/xilinx_hwicap.h b/drivers/char/xilinx_hwicap/xilinx_hwicap.h
> new file mode 100644
> index 0000000..5718679
> --- /dev/null
> +++ b/drivers/char/xilinx_hwicap/xilinx_hwicap.h
> @@ -0,0 +1,193 @@

> +#ifndef XILINX_HWICAP_H_	/* prevent circular inclusions */
> +#define XILINX_HWICAP_H_	/* by using protection macros */
> +
> +#include <linux/types.h>
> +#include <linux/cdev.h>
> +#include <linux/version.h>
> +#include <linux/platform_device.h>
> +
> +#include <asm/io.h>
> +
> +struct hwicap_drvdata {

BTW, you can also use kernel-doc for structs, unions, & enums.

> +	u32 write_buffer_in_use;  /* Always in [0,3] */
> +	u8 write_buffer[4];
> +	u32 read_buffer_in_use;	  /* Always in [0,3] */
> +	u8 read_buffer[4];
> +	resource_size_t mem_start;/* phys. address of the control registers */
> +	resource_size_t mem_end;  /* phys. address of the control registers */
> +	resource_size_t mem_size;
> +	void __iomem *base_address;/* virt. address of the control registers */
> +
> +	struct device *dev;
> +	struct cdev cdev;	/* Char device structure */
> +	dev_t devt;
> +
> +	const struct hwicap_driver_config *config;
> +	const struct config_registers *config_regs;
> +	void *private_data;
> +	bool is_open;
> +	struct mutex sem;
> +};
> +
> +struct hwicap_driver_config {
> +	int (*get_configuration)(struct hwicap_drvdata *drvdata, u32 *data,
> +			u32 size);
> +	int (*set_configuration)(struct hwicap_drvdata *drvdata, u32 *data,
> +			u32 size);
> +	void (*reset)(struct hwicap_drvdata *drvdata);
> +};
> +
> +/* Number of times to poll the done regsiter */
> +#define XHI_MAX_RETRIES     10


---
~Randy

  parent reply	other threads:[~2008-02-08 16:51 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-07 20:08 Xilinx: hwicap driver comments Jiri Slaby
2008-02-07 20:34 ` Grant Likely
2008-02-07 21:10   ` Stephen Neuendorffer
2008-02-07 20:42 ` Andrew Morton
2008-02-07 20:54   ` Grant Likely
2008-02-07 21:21     ` Andrew Morton
2008-02-07 21:31       ` Grant Likely
2008-02-07 21:35         ` Stephen Neuendorffer
2008-02-07 21:53           ` Andrew Morton
2008-02-07 22:00             ` Stephen Neuendorffer
2008-02-07 21:40       ` Linus Torvalds
2008-02-07 21:25     ` Benjamin Herrenschmidt
2008-02-07 21:35   ` Josh Boyer
2008-02-07 22:11     ` Andrew Morton
2008-02-07 22:58       ` Josh Boyer
2008-02-07 21:17 ` Benjamin Herrenschmidt
2008-02-07 21:28   ` Jiri Slaby
2008-02-07 21:33     ` Benjamin Herrenschmidt
2008-02-07 21:35       ` Grant Likely
2008-02-07 22:31 ` Stephen Neuendorffer
2008-02-07 22:39   ` Jiri Slaby
2008-02-08  2:17 ` [PATCH] [POWERPC] Xilinx: hwicap driver Stephen Neuendorffer
2008-02-08  9:10   ` Jiri Slaby
2008-02-08 16:49   ` Randy Dunlap [this message]
2008-02-08 17:08 ` Xilinx: hwicap driver comments Stephen Neuendorffer

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=20080208084954.9c311e36.randy.dunlap@oracle.com \
    --to=randy.dunlap@oracle.com \
    --cc=grant.likely@secretlab.ca \
    --cc=jirislaby@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=stephen.neuendorffer@xilinx.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®