mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mildred Frisco <mildred.frisco@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: how to initialize resource on linux 2.4
Date: Thu, 30 Dec 2004 13:03:43 +0800	[thread overview]
Message-ID: <e7b30b240412292103319e92c0@mail.gmail.com> (raw)

Hi,

I am porting for mx1 board and I am wondering how to initialize device
resources or adding 'struct resource' in linux 2.4.20.  In 2.6 kernel,
this is done in generic.c by

--------------------------------
...
...
static struct platform_device imx_uart2_device = {
       .name           = "imx-uart",
       .id             = 1,
       .num_resources  = ARRAY_SIZE(imx_uart2_resources),
       .resource       = imx_uart2_resources,
};

static struct imxfb_mach_info imx_fb_info;

void __init set_imx_fb_info(struct imxfb_mach_info *hard_imx_fb_info)
{
       memcpy(&imx_fb_info,hard_imx_fb_info,sizeof(struct imxfb_mach_info));
}
EXPORT_SYMBOL(set_imx_fb_info);

static struct resource imxfb_resources[] = {
       [0] = {
               .start  = 0x00205000,
               .end    = 0x002050FF,
               .flags  = IORESOURCE_MEM,
       },
       [1] = {
               .start  = LCDC_INT,
               .end    = LCDC_INT,
               .flags  = IORESOURCE_IRQ,
       },
};

static u64 fb_dma_mask = ~(u64)0;

static struct platform_device imxfb_device = {
       .name           = "imx-fb",
       .id             = 0,
       .dev            = {
               .platform_data  = &imx_fb_info,
               .dma_mask       = &fb_dma_mask,
               .coherent_dma_mask = 0xffffffff,
       },
       .num_resources  = ARRAY_SIZE(imxfb_resources),
       .resource       = imxfb_resources,
};

static struct platform_device *devices[] __initdata = {
       &imx_mmc_device,
       &imxfb_device,
       &imx_uart1_device,
       &imx_uart2_device,
};

void __init
imx_map_io(void)
{
       iotable_init(imx_io_desc, ARRAY_SIZE(imx_io_desc));
}

static int __init imx_init(void)
{
       return platform_add_devices(devices, ARRAY_SIZE(devices));
}

subsys_initcall(imx_init);

-------------------------------------------------

'struct platform_device' doesn't seem to exist in 2.4.  On what part
of the code should I  create a 'struct resource' for a particular
device so that the driver can use it?

Thanks,
Mildred

                 reply	other threads:[~2004-12-30  5:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=e7b30b240412292103319e92c0@mail.gmail.com \
    --to=mildred.frisco@gmail.com \
    --cc=linux-kernel@vger.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

Powered by JetHome