On Friday, shares of Hewlett-Packard Company (HPQ 0.34%) closed at $30.02. This was the first time HP stock ended the day above $30 in two and a half years!

HP has been through some rough sledding in recent years, but the business is finally stabilizing and the company is expected to post EPS growth this year for the first time since 2010.

HP's two most important businesses -- printing and enterprise hardware -- ended the 2013 fiscal year with strong momentum. There's a good chance HP has maintained this momentum going into 2014. If HP's upcoming earnings report confirms this improving picture, HP stock could surge even higher.

Long road back from chaos
The last time HP shares ended the day above $30 was August 17, 2011. (HP stock closed at $31.39.) The next day, HP issued a weak earnings forecast, discontinued its slow-selling WebOS-based smartphones and tablets, stated that it was buying British software firm Autonomy for more than $10 billion, and announced that it was considering a spinoff of its PC business!

This marked the beginning of chaos at HP. Within a month, HP's board had given CEO Leo Apotheker the boot, replacing him with current CEO Meg Whitman. A few months later, HP decided to keep the PC business after all. A year after that, HP took a massive $8.8 billion writedown on its purchase of Autonomy, alleging that it had been defrauded because of improper accounting procedures at Autonomy.

Incidentally, on the same day HP disclosed the Autonomy writedown, its stock bottomed out at $11.35. Since then, it has come roaring back, gaining more than 150% through the end of last week.

HPQ Chart

Hewlett-Packard 5 Year Stock Chart, data by YCharts

Some of HP's gains can probably be attributed to the strong performance of the stock market. However, it has also started to show clear signs of progress in its turnaround.

Signs of progress
HP's two most important business segments are printing and the "Enterprise Group," which primarily sells enterprise hardware like servers, storage, and networking. Together, these two businesses account for 70%-75% of HP's segment profit.

These two businesses also happen to be the furthest ahead in the turnaround process. Luckily, while the PC and enterprise services businesses both continue to struggle, neither one is a particularly significant contributor to HP's earnings anymore.

HP makes lots of money selling high-margin ink and toner.

In printing, HP actually grew segment pre-tax earnings by 8.5% last year. HP is likely to deliver another year of strong earnings growth in the printing business in 2014. First, the company has been dialing back on sales of low-margin consumer printers in favor of commercial printers that will get heavy use and drive long-term sales of high-margin ink and toner. Commercial printer sales actually rose 9% in Q4 of 2013.

Second, HP will continue to get a big margin benefit from the weak Japanese yen. The company sources toner and many printer components from Japan, so as the dollar appreciates against the yen, HP's costs decline.

US Dollar to Japanese Yen Exchange Rate Chart

US Dollar to Japanese Yen Exchange Rate data by YCharts.

The Enterprise Group hasn't performed quite as well as printing. In fact, it posted a 17% decline in pre-tax earnings last year. That said, by Q4 it was showing clear signs of improvement, punctuated by a surprising return to revenue growth -- although earnings continued to decline.

2014 could be a pivotal year for HP's Enterprise Group. The declining parts of the enterprise hardware business, such as UNIX servers and tape-based storage, are now small enough that their declines can be outweighed by growth businesses. This includes the "Moonshot" line of micro-servers and the 3PAR line of next-generation storage arrays. As these newer product lines scale up in the next few years, they should drive a return to profit growth in the Enterprise Group.

Foolish bottom line
Last year, HP made significant progress turning around its two most profitable businesses. It also finished repairing its balance sheet, surpassing its target of reaching zero net debt by the end of 2013. This allows it to more aggressively return cash to shareholders.

CEO Meg Whitman has previously warned that HP's turnaround progress will be uneven, so there is no guarantee that the upcoming earnings report will live up to expectations. However, with the printing and enterprise hardware businesses steadily improving throughout 2013, the general trend this year is likely to be positive. With HP's earnings multiple still sitting at about half the market average, the risk-reward trade-off for HP continues to look attractive.