All of lore.kernel.org
 help / color / mirror / Atom feed
* How to populate Battery information through ACPI tables
@ 2013-02-19 15:07 Pallala, Ramakrishna
  2013-02-19 15:20 ` Westerberg, Mika
  0 siblings, 1 reply; 11+ messages in thread
From: Pallala, Ramakrishna @ 2013-02-19 15:07 UTC (permalink / raw)
  To: linux-kernel, Westerberg, Mika,
	Mika Westerberg (mika.westerberg@linux.intel.com),
	Zhang, Rui

Hi All,

I am trying to populate battery related information through ACPI tables and do battery management through non acpi drivers.
Can you tell or point me on how to populate the ACPI tables in FW/BIOS and get them in OS? I am new to ACPI world.

Thanks,
Ram

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: How to populate Battery information through ACPI tables
  2013-02-19 15:07 How to populate Battery information through ACPI tables Pallala, Ramakrishna
@ 2013-02-19 15:20 ` Westerberg, Mika
  2013-02-19 17:11   ` Pallala, Ramakrishna
  0 siblings, 1 reply; 11+ messages in thread
From: Westerberg, Mika @ 2013-02-19 15:20 UTC (permalink / raw)
  To: Pallala, Ramakrishna; +Cc: linux-kernel, Zhang, Rui

On Tue, Feb 19, 2013 at 03:07:57PM +0000, Pallala, Ramakrishna wrote:
> I am trying to populate battery related information through ACPI tables
> and do battery management through non acpi drivers.  Can you tell or
> point me on how to populate the ACPI tables in FW/BIOS and get them in
> OS? I am new to ACPI world.

You should start by reading Documentation/acpi/enumeration.txt.

Also can you describe with bit more details, what you are trying to do? A
new battery driver that is enumerated from ACPI namespace, perhaps?

Do you have a DSDT table in hand which we could take a peek?

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: How to populate Battery information through ACPI tables
  2013-02-19 15:20 ` Westerberg, Mika
@ 2013-02-19 17:11   ` Pallala, Ramakrishna
  2013-02-19 17:42     ` Westerberg, Mika
  0 siblings, 1 reply; 11+ messages in thread
From: Pallala, Ramakrishna @ 2013-02-19 17:11 UTC (permalink / raw)
  To: Westerberg, Mika; +Cc: linux-kernel, Zhang, Rui


> On Tue, Feb 19, 2013 at 03:07:57PM +0000, Pallala, Ramakrishna wrote:
> > I am trying to populate battery related information through ACPI
> > tables and do battery management through non acpi drivers.  Can you
> > tell or point me on how to populate the ACPI tables in FW/BIOS and get
> > them in OS? I am new to ACPI world.
> 
> You should start by reading Documentation/acpi/enumeration.txt.
> 
> Also can you describe with bit more details, what you are trying to do? A new
> battery driver that is enumerated from ACPI namespace, perhaps?
> 
> Do you have a DSDT table in hand which we could take a peek?

Thanks Mika for the pointers. I have looked at the documentation.

we already have i2c driver for battery monitoring but the chip needs initialized with
characterization data. We wanted to populate/pass this data through ACPI table to the
i2c slave driver.

How can I do that? Can I pass characterization data through ACPI table to the i2c slave device?

Thanks,
Ram


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: How to populate Battery information through ACPI tables
  2013-02-19 17:11   ` Pallala, Ramakrishna
@ 2013-02-19 17:42     ` Westerberg, Mika
  2013-02-19 17:45       ` Pallala, Ramakrishna
  0 siblings, 1 reply; 11+ messages in thread
From: Westerberg, Mika @ 2013-02-19 17:42 UTC (permalink / raw)
  To: Pallala, Ramakrishna; +Cc: linux-kernel, Zhang, Rui

On Tue, Feb 19, 2013 at 07:11:52PM +0200, Pallala, Ramakrishna wrote:
> 
> > On Tue, Feb 19, 2013 at 03:07:57PM +0000, Pallala, Ramakrishna wrote:
> > > I am trying to populate battery related information through ACPI
> > > tables and do battery management through non acpi drivers.  Can you
> > > tell or point me on how to populate the ACPI tables in FW/BIOS and get
> > > them in OS? I am new to ACPI world.
> > 
> > You should start by reading Documentation/acpi/enumeration.txt.
> > 
> > Also can you describe with bit more details, what you are trying to do? A new
> > battery driver that is enumerated from ACPI namespace, perhaps?
> > 
> > Do you have a DSDT table in hand which we could take a peek?
> 
> Thanks Mika for the pointers. I have looked at the documentation.
> 
> we already have i2c driver for battery monitoring but the chip needs initialized with
> characterization data. We wanted to populate/pass this data through ACPI table to the
> i2c slave driver.
> 
> How can I do that? Can I pass characterization data through ACPI table to
> the i2c slave device?

Is the characterization data available in DSDT (or SSDT) table? If yes,
then you can just use the fact that ACPI_HANDLE(&i2c_client->dev) returns a
valid ACPI handle for your device. You can use this handle to call some
ACPI method or whaterver is needed to extract that information.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: How to populate Battery information through ACPI tables
  2013-02-19 17:42     ` Westerberg, Mika
@ 2013-02-19 17:45       ` Pallala, Ramakrishna
  2013-02-19 18:04         ` Westerberg, Mika
  0 siblings, 1 reply; 11+ messages in thread
From: Pallala, Ramakrishna @ 2013-02-19 17:45 UTC (permalink / raw)
  To: Westerberg, Mika; +Cc: linux-kernel, Zhang, Rui

> > > On Tue, Feb 19, 2013 at 03:07:57PM +0000, Pallala, Ramakrishna wrote:
> > > > I am trying to populate battery related information through ACPI
> > > > tables and do battery management through non acpi drivers.  Can
> > > > you tell or point me on how to populate the ACPI tables in FW/BIOS
> > > > and get them in OS? I am new to ACPI world.
> > >
> > > You should start by reading Documentation/acpi/enumeration.txt.
> > >
> > > Also can you describe with bit more details, what you are trying to
> > > do? A new battery driver that is enumerated from ACPI namespace, perhaps?
> > >
> > > Do you have a DSDT table in hand which we could take a peek?
> >
> > Thanks Mika for the pointers. I have looked at the documentation.
> >
> > we already have i2c driver for battery monitoring but the chip needs
> > initialized with characterization data. We wanted to populate/pass
> > this data through ACPI table to the i2c slave driver.
> >
> > How can I do that? Can I pass characterization data through ACPI table
> > to the i2c slave device?
> 
> Is the characterization data available in DSDT (or SSDT) table? If yes, then you
> can just use the fact that ACPI_HANDLE(&i2c_client->dev) returns a valid ACPI
> handle for your device. You can use this handle to call some ACPI method or
> whaterver is needed to extract that information.

As of now this data is not there in any table. I want to put this data in DSDT table.
The data I want to put is specific to the device  and will be around 1K bytes.

One question, How the table and device are linked? Is it by device name/id?
Next, how to put this characterization data into the DSDT table?

Thanks,
Ram

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: How to populate Battery information through ACPI tables
  2013-02-19 17:45       ` Pallala, Ramakrishna
@ 2013-02-19 18:04         ` Westerberg, Mika
  2013-02-19 18:22           ` Pallala, Ramakrishna
  0 siblings, 1 reply; 11+ messages in thread
From: Westerberg, Mika @ 2013-02-19 18:04 UTC (permalink / raw)
  To: Pallala, Ramakrishna; +Cc: linux-kernel, Zhang, Rui

On Tue, Feb 19, 2013 at 07:45:38PM +0200, Pallala, Ramakrishna wrote:
> > > > On Tue, Feb 19, 2013 at 03:07:57PM +0000, Pallala, Ramakrishna wrote:
> > > > > I am trying to populate battery related information through ACPI
> > > > > tables and do battery management through non acpi drivers.  Can
> > > > > you tell or point me on how to populate the ACPI tables in FW/BIOS
> > > > > and get them in OS? I am new to ACPI world.
> > > >
> > > > You should start by reading Documentation/acpi/enumeration.txt.
> > > >
> > > > Also can you describe with bit more details, what you are trying to
> > > > do? A new battery driver that is enumerated from ACPI namespace, perhaps?
> > > >
> > > > Do you have a DSDT table in hand which we could take a peek?
> > >
> > > Thanks Mika for the pointers. I have looked at the documentation.
> > >
> > > we already have i2c driver for battery monitoring but the chip needs
> > > initialized with characterization data. We wanted to populate/pass
> > > this data through ACPI table to the i2c slave driver.
> > >
> > > How can I do that? Can I pass characterization data through ACPI table
> > > to the i2c slave device?
> > 
> > Is the characterization data available in DSDT (or SSDT) table? If yes, then you
> > can just use the fact that ACPI_HANDLE(&i2c_client->dev) returns a valid ACPI
> > handle for your device. You can use this handle to call some ACPI method or
> > whaterver is needed to extract that information.
> 
> As of now this data is not there in any table. I want to put this data in DSDT table.
> The data I want to put is specific to the device  and will be around 1K bytes.
> 
> One question, How the table and device are linked? Is it by device name/id?

In principle, yes. We create devices based on the IDs on the DSDT table.

> Next, how to put this characterization data into the DSDT table?

Typically this is done by BIOS team but you can experiment yourself just by
taking an existing DSDT, disassembling it with iasl, do the changes and
reassembling it again. You can then include this with your kernel or initrd
image.

I have no idea how that data is supposed to look like or be represented in
the DSDT.

You should also familiarize yourself with ACPI by reading the ACPI 5.0 spec
from acpi.info.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: How to populate Battery information through ACPI tables
  2013-02-19 18:04         ` Westerberg, Mika
@ 2013-02-19 18:22           ` Pallala, Ramakrishna
  2013-02-19 18:38             ` Westerberg, Mika
  0 siblings, 1 reply; 11+ messages in thread
From: Pallala, Ramakrishna @ 2013-02-19 18:22 UTC (permalink / raw)
  To: Westerberg, Mika; +Cc: linux-kernel, Zhang, Rui

> > > > > > I am trying to populate battery related information through
> > > > > > ACPI tables and do battery management through non acpi
> > > > > > drivers.  Can you tell or point me on how to populate the ACPI
> > > > > > tables in FW/BIOS and get them in OS? I am new to ACPI world.
> > > > >
> > > > > You should start by reading Documentation/acpi/enumeration.txt.
> > > > >
> > > > > Also can you describe with bit more details, what you are trying
> > > > > to do? A new battery driver that is enumerated from ACPI namespace,
> perhaps?
> > > > >
> > > > > Do you have a DSDT table in hand which we could take a peek?
> > > >
> > > > Thanks Mika for the pointers. I have looked at the documentation.
> > > >
> > > > we already have i2c driver for battery monitoring but the chip
> > > > needs initialized with characterization data. We wanted to
> > > > populate/pass this data through ACPI table to the i2c slave driver.
> > > >
> > > > How can I do that? Can I pass characterization data through ACPI
> > > > table to the i2c slave device?
> > >
> > > Is the characterization data available in DSDT (or SSDT) table? If
> > > yes, then you can just use the fact that
> > > ACPI_HANDLE(&i2c_client->dev) returns a valid ACPI handle for your
> > > device. You can use this handle to call some ACPI method or whaterver is
> needed to extract that information.
> >
> > As of now this data is not there in any table. I want to put this data in DSDT
> table.
> > The data I want to put is specific to the device  and will be around 1K bytes.
> >
> > One question, How the table and device are linked? Is it by device name/id?
> 
> In principle, yes. We create devices based on the IDs on the DSDT table.
> 
> > Next, how to put this characterization data into the DSDT table?
> 
> Typically this is done by BIOS team but you can experiment yourself just by
> taking an existing DSDT, disassembling it with iasl, do the changes and
> reassembling it again. You can then include this with your kernel or initrd image.
> 
> I have no idea how that data is supposed to look like or be represented in the
> DSDT.
> 
> You should also familiarize yourself with ACPI by reading the ACPI 5.0 spec from
> acpi.info.

Mika, I want to populate this characterization data as device specific/custom data which could be anything
And may not be entirely related to battery. Is this is possible?

I will also go through the spec but this info would help me to resolve some initial hurdles in my work.

Note: I am not going to use ACPI based battery monitoring but I need this data from acpi tables.

Thanks,
Ram

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: How to populate Battery information through ACPI tables
  2013-02-19 18:22           ` Pallala, Ramakrishna
@ 2013-02-19 18:38             ` Westerberg, Mika
  2013-02-19 18:59               ` Pallala, Ramakrishna
  0 siblings, 1 reply; 11+ messages in thread
From: Westerberg, Mika @ 2013-02-19 18:38 UTC (permalink / raw)
  To: Pallala, Ramakrishna; +Cc: linux-kernel, Zhang, Rui

On Tue, Feb 19, 2013 at 08:22:01PM +0200, Pallala, Ramakrishna wrote:
> Mika, I want to populate this characterization data as device
> specific/custom data which could be anything And may not be entirely
> related to battery. Is this is possible?

Yes, for example you could have a custom ACPI method with your device which
then returns this information.

See for example chapter 10.2.2.1 from the ACPI spec. It describes _BIF
method that returns some battery data to the caller.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: How to populate Battery information through ACPI tables
  2013-02-19 18:38             ` Westerberg, Mika
@ 2013-02-19 18:59               ` Pallala, Ramakrishna
  2013-02-19 19:20                 ` Westerberg, Mika
  0 siblings, 1 reply; 11+ messages in thread
From: Pallala, Ramakrishna @ 2013-02-19 18:59 UTC (permalink / raw)
  To: Westerberg, Mika; +Cc: linux-kernel, Zhang, Rui

> > Mika, I want to populate this characterization data as device
> > specific/custom data which could be anything And may not be entirely
> > related to battery. Is this is possible?
> 
> Yes, for example you could have a custom ACPI method with your device which
> then returns this information.
> 
> See for example chapter 10.2.2.1 from the ACPI spec. It describes _BIF method
> that returns some battery data to the caller.

Mika, _BIF method returns battery data/struct which is defined Table. 10-233.

If I want to pass some device specific data seems like I can use _DSM(9.14.1) method and pass custom /device specific data to the driver.
And I believe this data format can be anything and private to the device? Can you confirm?

Thanks,
Ram

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: How to populate Battery information through ACPI tables
  2013-02-19 18:59               ` Pallala, Ramakrishna
@ 2013-02-19 19:20                 ` Westerberg, Mika
  2013-02-19 19:39                   ` Pallala, Ramakrishna
  0 siblings, 1 reply; 11+ messages in thread
From: Westerberg, Mika @ 2013-02-19 19:20 UTC (permalink / raw)
  To: Pallala, Ramakrishna; +Cc: linux-kernel, Zhang, Rui

On Tue, Feb 19, 2013 at 08:59:29PM +0200, Pallala, Ramakrishna wrote:
> > > Mika, I want to populate this characterization data as device
> > > specific/custom data which could be anything And may not be entirely
> > > related to battery. Is this is possible?
> > 
> > Yes, for example you could have a custom ACPI method with your device which
> > then returns this information.
> > 
> > See for example chapter 10.2.2.1 from the ACPI spec. It describes _BIF method
> > that returns some battery data to the caller.
> 
> Mika, _BIF method returns battery data/struct which is defined Table. 10-233.

Yes, it was just an example. You can have your own custom method for that,
lets say:

	BLAH()

that then returns whatever you need.

> If I want to pass some device specific data seems like I can use
> _DSM(9.14.1) method and pass custom /device specific data to the driver.

_DSM is also an option, yes.

> And I believe this data format can be anything and private to the device?
> Can you confirm?

Yes.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: How to populate Battery information through ACPI tables
  2013-02-19 19:20                 ` Westerberg, Mika
@ 2013-02-19 19:39                   ` Pallala, Ramakrishna
  0 siblings, 0 replies; 11+ messages in thread
From: Pallala, Ramakrishna @ 2013-02-19 19:39 UTC (permalink / raw)
  To: Westerberg, Mika; +Cc: linux-kernel, Zhang, Rui


> > Mika, _BIF method returns battery data/struct which is defined Table. 10-233.
> 
> Yes, it was just an example. You can have your own custom method for that, lets
> say:
> 
> 	BLAH()
> 
> that then returns whatever you need.
> 
> > If I want to pass some device specific data seems like I can use
> > _DSM(9.14.1) method and pass custom /device specific data to the driver.
> 
> _DSM is also an option, yes.
> 
> > And I believe this data format can be anything and private to the device?
> > Can you confirm?
> 
> Yes.

Gr8. Appreciate your prompt response and help.
Have nice day :-)

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-02-19 19:39 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-19 15:07 How to populate Battery information through ACPI tables Pallala, Ramakrishna
2013-02-19 15:20 ` Westerberg, Mika
2013-02-19 17:11   ` Pallala, Ramakrishna
2013-02-19 17:42     ` Westerberg, Mika
2013-02-19 17:45       ` Pallala, Ramakrishna
2013-02-19 18:04         ` Westerberg, Mika
2013-02-19 18:22           ` Pallala, Ramakrishna
2013-02-19 18:38             ` Westerberg, Mika
2013-02-19 18:59               ` Pallala, Ramakrishna
2013-02-19 19:20                 ` Westerberg, Mika
2013-02-19 19:39                   ` Pallala, Ramakrishna

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.